Skip to main content
gamedev.net
🔒 Locked

MessageBox Problem

Started by Gelmir 4 replies 1k views
Original Post
Gelmir
Gelmir
Hello everybody. I''am developing a 3d-world editor in Win32. The main window creates a OpenGL context that is used to render the scene. The problem is when I try to display a message box using the API MessageBox function. The main window lost the focus, but the dialog isn´t shown. I have tried all styles for the dialog box but no one doesn''t work. The only strange thing I make with the main Window is make it to be the foreground window with the SetForegroundWindow function and then set the focus to it with the SetFocus function. The styles I are using for the window class are : - CS_HREDRAW, CS_VREDRAW and CS_OWNDC The styles I pass to CreateWindow function are : - WS_MINIMIZEBOX, WS_VISIBLE, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_MAXIMIZEBOX, WS_CAPTION, WS_BORDER, WS_SYSMENU and WS_THICKFRAME. Someone has any idea to solve that problem? Thanx to all !!!
"If you''re gonna die, die with your boots on"
Shannon Barber
Shannon Barber
What do you set the parent of the message box to?
Make sure it''s the main app window, and if that still doesn;t work try NULL...

Magmai Kai Holmlor
- Not For Rent
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Gelmir
Gelmir
Thanx for the replay MKH, but i''d tried that before and it didn''t work neither passing the parent window nor the NULL pointer.

If I pass the NULL pointer, the main window continues receiving and handling messages from the menu, buttons, etc. but when passing the pointer to the main window, the app gets bloqued and doesn''t respond messages.
"If you''re gonna die, die with your boots on"
Halloween
Halloween
Guess what?.. I''ve got just the same problem right now. The only difference is that I am trying to show message box from the custom-draw window under MFC. Window loses focus, but message box doesn''t appear until I am pressing Alt key (I''m working under Win2k). Even MB_SYSTEMMODAL message box style doesn''t help
Parent NULL doesn''t help too.
Halloween
Halloween
To Anonymous Poster:
Look, man! You are right. Thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.