-
August 29th, 2012, 01:00 PM
#1
[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
-
August 29th, 2012, 02:06 PM
#2
Re: Why this dialog isn't caused?
Define "isn't caused".
Victor Nijegorodov
-
August 29th, 2012, 02:22 PM
#3
Re: Why this dialog isn't caused?
VictorN, isn't invoked, correctly...
-
August 29th, 2012, 02:24 PM
#4
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
-
August 29th, 2012, 03:31 PM
#5
Re: Why this dialog isn't caused?
DialogBox is needed. Solved.
-
September 1st, 2012, 02:43 AM
#6
Re: Why this dialog isn't caused?
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
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|