TOP Win32API
Modal | Modaless | |
parent | disabled | enabled |
message loop | integrated | not integrated |
invoke | DialogBox() | CreateDialog() |
close | EndDialog() | DestroyWindow() |
WM_DESTROY | -- | PostQuitMessage() |
TAB | no | yes |
BOOL CALLBACK DlgTest01Proc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam){ UINT wID; switch(msg) { case WM_CLOSE: EndDialog(hWnd,IDOK); break; case WM_INITDIALOG: break; case WM_COMMAND: // handle menu message /* wID = LOWORD(wParam); switch (wID) { case 1: break; default: break; } */ break; // end of WM_COMMAND } return FALSE; } int WINAPI WinMain(HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR lpCmdLine , int nCmdShow ) { DialogBox(hInstance, TEXT("DlgTest01"), NULL, DlgTest01Proc); return 0; }
int WINAPU WinMain(HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR lpCmdLine , int nCmdShow ) { DLGPROC lpProc = (DLGPROC)MakeProcInstance((FARPROC)dlg_proc, hInstance); HWND hDlg=CreateDialog(hInstance, "DlgProc", NULL, lpProc); MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { if (!IsDialogMessage(hDlg, &msg)){ /* tab,cr */ TranslateMessage(&msg); DispatchMessage(&msg); } } FreeProcInstance((FARPROC)lpProc); return 0; }
最新コメント