|
-
Feb 22nd, 2002, 09:50 AM
#1
Thread Starter
Member
MessageBox API
As I mentioned in an earlier post, I'm using the MessageBox API call to display a message before running a console application.
Unfortunately, this acts as a "modal" form within my application. In other words, I can freely access other Windows, but my console application will not continue execution until the message box is closed.
I tried to set the hWnd parameter to NULL and HWND_DESKTOP, but neither changes the behavior. Is there a way to keep the MessageBox on the desktop and allow my program to continue execution? Do I need to use a different API call?
Any help would be greatly appreciated..
-
Feb 22nd, 2002, 10:47 AM
#2
MBAPPLMODAL - message box application modal is the default behavior. You need to use another kind of dialog box.
-
Feb 22nd, 2002, 01:16 PM
#3
Thread Starter
Member
-
Feb 22nd, 2002, 06:56 PM
#4
Fanatic Member
Alcohol & calculus don't mix.
Never drink & derive.
-
Feb 23rd, 2002, 12:10 PM
#5
Create your own dialog template and dialog proc and use CreateDialog.
You must extend your message loop then:
Code:
while(GetMessage(&msg, NULL, 0, 0) > 0)
{
if(!IsDlgMessage(hdlg, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
hdlg is the handle returned by CreateDialog.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 24th, 2002, 04:59 PM
#6
Monday Morning Lunatic
How about starting a new thread? That should allow the program to continue. Note that if the program finishes, the message box will automagically be closed.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 25th, 2002, 10:36 AM
#7
Good idea. Like
Code:
DWORD MBThreadMain(LPVOID pVoid)
{
MessageBox(NULL, "Hello", "Hello", MB_OK);
return 0;
}
If you at one point want to stop until the messagebox is closed, use WaitForSingleObject
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|