DialogBox problem
-
I create DialogBox using Api Windows my question is how to get handle to this dialog before the dialog appears? in MFC i got CMyDlg dlg; now I am able to pass dlg somwhere (to the tread in my case) and I do dlg.doModal; I want to do similar thing in WinAPi but if I do DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog); the dialog box appears imiedetly, and I don't have HWND of it. Please help
-
I create DialogBox using Api Windows my question is how to get handle to this dialog before the dialog appears? in MFC i got CMyDlg dlg; now I am able to pass dlg somwhere (to the tread in my case) and I do dlg.doModal; I want to do similar thing in WinAPi but if I do DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog); the dialog box appears imiedetly, and I don't have HWND of it. Please help
It's not possible to work with the
HWND
of a dialog before the dialog is created! There exists noHWND
until the dialog is created! If you want to use some functions that uses theHWND
the dialog have to exist, otherwise the doesn't work! Daniel ;) --------------------------- Never change a running system! -
I create DialogBox using Api Windows my question is how to get handle to this dialog before the dialog appears? in MFC i got CMyDlg dlg; now I am able to pass dlg somwhere (to the tread in my case) and I do dlg.doModal; I want to do similar thing in WinAPi but if I do DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog); the dialog box appears imiedetly, and I don't have HWND of it. Please help
Grab WM_INITDIALOG inside your authDialog proc. You can do the same stuff here you would do in OnInitDialog() Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com