wongjieyi
April 19th, 2007, 11:24 PM
Hi,
I use the following code to open a new dialog box.
DialogBox(hInst, (LPCTSTR) IDD_PressSpaceBar, hWndParent, (DLGPROC) PressSpaceBar);
But according MSDN, DialogBox will
DialogBox does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.
So is there a function which i can call that will not take over the control of my main dialog??
The flow of my program is as such,
1) Press button to run a CreateProcess function
2) After 3 seconds, I would want a dialog to pop up [ for this case i use DialogBox function]
3) WaitForSingleObject(piProcInfo.hThread, INFINITE) for the Process to end
4) After the process ends, I would want the dialogbox to close by itself.
Anyone can help me out.
My current code is
CreateProcess(...)
Sleep(3000);
hWndParent = GetDlgItem(NULL, IDD_PressSpaceBar);
DialogBox(hInst, (LPCTSTR) IDD_PressSpaceBar, hWndParent, (DLGPROC) PressSpaceBar);
WaitForSingleObject(piProcInfo.hThread, INFINITE);
DestroyWindow(hWndParent);
But it will not close the IDD_PressSpaceBar dialog box.
Thanks for your help.
I use the following code to open a new dialog box.
DialogBox(hInst, (LPCTSTR) IDD_PressSpaceBar, hWndParent, (DLGPROC) PressSpaceBar);
But according MSDN, DialogBox will
DialogBox does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.
So is there a function which i can call that will not take over the control of my main dialog??
The flow of my program is as such,
1) Press button to run a CreateProcess function
2) After 3 seconds, I would want a dialog to pop up [ for this case i use DialogBox function]
3) WaitForSingleObject(piProcInfo.hThread, INFINITE) for the Process to end
4) After the process ends, I would want the dialogbox to close by itself.
Anyone can help me out.
My current code is
CreateProcess(...)
Sleep(3000);
hWndParent = GetDlgItem(NULL, IDD_PressSpaceBar);
DialogBox(hInst, (LPCTSTR) IDD_PressSpaceBar, hWndParent, (DLGPROC) PressSpaceBar);
WaitForSingleObject(piProcInfo.hThread, INFINITE);
DestroyWindow(hWndParent);
But it will not close the IDD_PressSpaceBar dialog box.
Thanks for your help.