1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
//---------------------------------------------------------------------------
HWND hWnd;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
//---------------------------------------------------------------------------
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
int ret = DialogBox(NULL, MAKEINTRESOURCE(IDD_DIALOG1),
hWnd, reinterpret_cast<DLGPROC>(DlgProc));
if(ret == IDOK)MessageBox(NULL,"clique sur OK","OK",MB_OK);
return FALSE;
}
//---------------------------------------------------------------------------
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
SetDlgItemText(hWndDlg, IDMESSAGE, "message");
SetDlgItemText(hWndDlg, IDHEAP, "contenu de la pile");
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDOK:
EndDialog(hWndDlg, IDOK);
return TRUE;
case IDCANCEL:
EndDialog(hWndDlg, IDCANCEL);
return TRUE;
case IDRETRY:
EndDialog(hWndDlg, IDRETRY);
return TRUE;
}
break;
}
return FALSE;
} |
Partager