This is the code i use in the regular win32 code:
while (PeekMessage (&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage (&Message);
DispatchMessage (&Message);
if (Message.message == WM_QUIT)
pBase->Quit = TRUE;
}
and this is the code i use in the SDL code:
while (SDL_PollEvent (&Event))
{
… lots and lots of code to grab input and other stuff
}
Which is run each frame.
I just did a test and ran both the SDL_PollEvents loop AND the plain win32
PeekMessage thing right before creating my DialogBox just to be sure that
all messages are flushed out and it still wont show up.
A simple MessageBox works just fine tho.
MessageBox (NULL, “Test”, “Test”, MB_OK);
// Tomaz
----Original Message Follows----From: darkmatter@freeuk.com (Peter Mulholland)
Reply-To: Peter Mulholland ,“A list for developers
using the SDL library. (includesSDL-announce)”
To: "A list for developers using the SDL library. (includes
SDL-announce)"
Subject: Re: [SDL] Dialog boxes.
Date: Mon, 13 Mar 2006 20:08:31 +0000
Hello Tomas,
Monday, March 13, 2006, 7:56:39 PM, you wrote:
TJ> Im sorry. The code i pasted was the wrong code.
TJ> This is the actual code.
pLights->>Dialog = CreateDialog (GetModuleHandle (NULL),
TJ> MAKEINTRESOURCE(IDD_DIALOG_LIGHTS), NULL, Edit_Proc);
if (pLights->>Dialog)
TJ> ShowWindow (pLights->Dialog, SW_SHOW);
TJ> This is the actual code is it is now when not using SDL for anything and
TJ> this works just fine.
TJ> You do not need a parent window to get the dialog box to display.
TJ> In fact. IF you give it a parentwindow then you will not get it showing
in
TJ> the taskbar and can not ALT+TBA between the game window and the
DialogBox.
Hmm.
The catch is that dialogs are not really proper windows, hence why the
dialog proc is different to a window proc. Yes, this is totally stupid
of MS to do it this way.
It must be something to do with the message loop that’s inside the
display drivers, handling the input events. If you don’t call
SDL_PumpEvents regularly, the windows message loop doesn’t run.
This could mean important setup messages are never dispatched, and
therefore your dialog window never appears
Try opening your dialog, then calling SDL_PumpEvents in a bit of a
loop, and see if your dialog works then.
TJ> And who has said anything about a standalone shell?
By “shell” i meant as you said:
TJ> I did a quick test and removed the SDL window init code and made a
regular
TJ> win32 window and then the dialog box creation worked.
shell as in quick test code, not as in command line. Sorry
TJ> I clearly stated that this works when creating a window using regular
win32
TJ> code and not using SDL so there is nothing wrong with how i create my
TJ> DialogBox.
Do you have the normal GetMessage/DispatchMessage loop in your test
code?
–
Best regards,
Peter mailto:darkmatter at freeuk.com
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl