[RESOLVED] Why this dialog isn't caused?
Code:
INT_PTR CALLBACK MyInputDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
switch(iMsg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
WCHAR Temp[256];
GetDlgItemText(hDlg, IDC_EDIT1, Temp, 50);
CharToOem(Temp, TempName);
EndDialog(hDlg, FALSE);
break;
case IDCLOSE:
EndDialog(hDlg, FALSE);
break;
}
case WM_DESTROY:
DestroyWindow(hDlg);
break;
default:
return FALSE;
}
return TRUE;
}
....
CreateDialog(hInst, MAKEINTRESOURCE(IDD_INPUTBOX), hWnd, MyInputDlgProc); // this is simplisity passed
Re: Why this dialog isn't caused?
Define "isn't caused". :cool:
Re: Why this dialog isn't caused?
VictorN, isn't invoked, correctly...
Re: Why this dialog isn't caused?
See http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
If CreateDialog returns NULL call GetLastError to find out why
Re: Why this dialog isn't caused?
DialogBox is needed. Solved.
Re: Why this dialog isn't caused?
Quote:
Originally Posted by
AKE
DialogBox is needed. Solved.
It actually depends on what the purpose was. DialogBox creates modal dialog when CreateDialog creates modeless one.
Code:
HWND hDlg = CreateDialog(...); // this just creates dialog window
ShowWindow(hDlg, SW_SHOW); // unless WS_VISIBLE was specified at creation
UpdateWindow(hDlg);
// message pump is also needed running on this thread