DialogBox 函数使用疑问
#include <windows.h>#include "resource.h"
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {
DialogBox( hInstance, ( LPCTSTR ) IDD_DIALOG1, NULL, ( DLGPROC ) WndProc );
return 0;
}
LRESULT CALLBACK WndProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch(uMsg){
case WM_INITDIALOG:
{
}
break;
case WM_COMMAND:
switch(LOWORD( wParam )) {
case IDOK:
{
EndDialog( hDlg, 0 );
}
break;
};
break;
case WM_CLOSE:
EndDialog( hDlg, 0 );
break;
};
return 0;
}
看到 DialogBox 函数的例子 怎么最后个函数总是如上例一样使用 CALLBACK 进行修饰?但是其原型是
INT_PTR DialogBox( HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
好像并不是需要CALLBACK函数,到底怎么回事呢?