Originally posted by Extol
How do I make my dialog box the active window, instead of having it in back of the console.
Create a win32 project, create your dialog resource, and instead of main use WinMain, for example, using your original code:
Code:
#include <windows.h>
#include "resource.h" /*or whatever the path to your resource header is */
BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
}
return FALSE;
}
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE,LPSTR lpStr,int nCmdShow)
{
DialogBoxParam( GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)MainDialogProc, 0);
return 0;
}