We help IT Professionals succeed at work.

Create Dialog

win32
win32 asked
on
Medium Priority
281 Views
Last Modified: 2013-12-03
Hi, I want to make a Dialog that shows "Please wait..." The only problem is that It shall not be a standard Ok Cancel Dialog.. That wont work because the Main() will wait until the dialog has returned. I need a Dialog that I can create and destroy wheen needed, and that I don't have to wait on. Simply a text saying "Wait...".

How is that done with API or MFC ?
Comment
Watch Question

BJZ

Commented:
Use CreateWindowEx to make your dialog. Else create a thread that will launch your dialog so you needn't the dialog to return.

Use the CreateDialog() function, rather than the DialogBox() function.  CreateDialog() will return the window handle of the created dialog box as soon as it's created.  Then you can do whatever processing you want inside your main() function, and then destroy the dialog when your processing is done.  e.g...

// show wait dialog
HWND hWaitDlg = CreateDialog (hInst, MAKEINTRESOURCE(IDD_WAIT_DLG), NULL, DlgProc);

// do your processing here

// destroy wait dialog
DestroyWindow (hWaitDlg);

Good luck!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.