妈的,没想到上一篇就那么点新内容 ,我还把整段代码贴上去了。。
BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
switch (LOWORD(wparam))
{
case IDOK:
EndDialog(
hDlg, //Handle to the dialog to end.
0); //Return code.
break;
case IDCANCEL:
EndDialog(
hDlg, //Handle to the dialog to end.
0); //Return code.
break;
default:
break;
}
}
return true;
}
DialogBox(_hInstance, MAKEINTRESOURCE(IDD_DIALOG1), hwnd, AboutDlgProc);//BOOL BACK AboutDlgProc is our callback
We need to get a handle to the window and then call the dialog box function like this
这个MAKEINTRESOURCE 跟这个source.h的具体联系是什么 ,但是书上说source.h isautomatically created for us, we can manually edit it to name the dialog appropriately 。 这应该是这个M什么的是个文件吧。