Recognizes if input is ogg or not.
[xiph.git] / ao / win32 / src / uiutil.c
bloba46c70d2a97c66f6b3bdc3774dbe10bc11ca46ab
1 /*
2 * $Id: uiutil.c,v 1.1 2001/09/05 19:10:01 cwolf Exp $
3 * $Name: $
5 * Get the window handle of the controlling console of a console-mode
6 * application.
8 * This came right off Microsoft's MSDN library, so I doubt there's
9 * less kludgy way to handle this.
11 #define MY_BUFSIZE 1024 // Buffer size for console window titles.
13 HWND getConsoleWindow()
15 HWND hwndFound; // This is what is returned to the caller.
16 char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
17 // WindowTitle.
18 char pszOldWindowTitle[MY_BUFSIZE]; // Contains original
19 // WindowTitle.
21 // Fetch current window title.
22 GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
24 // Format a "unique" NewWindowTitle.
25 (void)wsprintf(pszNewWindowTitle,"%d/%d", GetTickCount(),
26 GetCurrentProcessId());
28 // Change current window title.
29 SetConsoleTitle(pszNewWindowTitle);
31 // Ensure window title has been updated.
32 Sleep(40);
34 // Look for NewWindowTitle.
35 hwndFound=FindWindow(NULL, pszNewWindowTitle);
37 // Restore original window title.
38 SetConsoleTitle(pszOldWindowTitle);
40 return(hwndFound);