I'm starting out with win32 programming.
I created my first dialog but I can't drag it around with my mouse; it simply stays where it is. Why?
This is its proc function:
static bool CALLBACK ChangeColumnProc(HWND dialog, uint32 message, WPARAM wParam, LPARAM lParam)
{
static ColumnInfo *column = NULL;
switch(message)
{
case WM_INITDIALOG:
column = (ColumnInfo *)lParam;
InitializeDialog(dialog, column);
return true;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
S开发者_StackOverflowaveChanges(dialog, column);
break;
case IDCANCEL:
EndDialog(dialog, lParam);
break;
default:
return false;
}
return true;
}
return false;
}
This is how I create it:
if(DialogBoxParam(StartupInfo.Instance, MAKEINTRESOURCE(IDD_CHANGE_COLUMN), StartupInfo.Window, (DLGPROC)ChangeColumnProc, (LPARAM)&column) == IDOK)
What am I doing wrong?
The return type of the dialog procedure is INT_PTR, not bool. Return (INT_PTR)FALSE if you don't handle the message.
精彩评论