Small SDL mod increasing winapi compatibility

Hey guys,

I've recently been working on a set of tools for my game engine - all of 

them confined in one central app. I’ve been using the winapi for toolbars,
menu’s, dialogs etc. Everything was grand - I use my own wndproc for
handling the windows menu and whatnot and it in turn calls the previously
stored wndproc when its done, returning control back to sdl.

Eitherway, I eventually hit a brick wall when it came to having edit 

boxes in my custom dialogs - they wernt receiving any input from the
keyboard. Then I noticed I couldnt tab through the dialog either. After
trying many many things I eventually ended up changing sdl itself.

Maybe its not the best way of going about this problem, but in the end I 

edited directx5_events.c - added two new functions SDL_RegisterUserDialog()
and SDL_UnregisterUserDialog(). They both take the HWND of an existing
dialog and sdl stores that in a small array - then I made a change to the
processing of messages where before continuing with normal messaging code it
cycles through the user dialogs array and performs an IsDialogMessage() on
it which checks if the message belongs to any of the dialogs and dispatches
it to them if so.

Everything is actually working great and I have all the control and 

whatnot that I would expect from my dialogs and I dont appear to of
inadvertantly broken any other part of sdl :slight_smile: Anyway, i’m just posting this
to tell people of this change and if its any use to anyone I can thwack the
modded code online for people to grab. In all my devving i’ve completly
missed the CVS scene so I dunno about any of that xD

Anyway, take care
-Dave

Maybe its not the best way of going about this problem, but in the end I 

edited directx5_events.c - added two new functions SDL_RegisterUserDialog()
and SDL_UnregisterUserDialog(). They both take the HWND of an existing
dialog and sdl stores that in a small array - then I made a change to the
processing of messages where before continuing with normal messaging code it
cycles through the user dialogs array and performs an IsDialogMessage() on
it which checks if the message belongs to any of the dialogs and dispatches
it to them if so.

Everything is actually working great and I have all the control and 

whatnot that I would expect from my dialogs and I dont appear to of
inadvertantly broken any other part of sdl :slight_smile: Anyway, i’m just posting this
to tell people of this change and if its any use to anyone I can thwack the
modded code online for people to grab.

Sure, go ahead and post it. :slight_smile:

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Dave <aoyx63 dsl.pipex.com> writes:

Hey guys,

I've recently been working on a set of tools for my game engine - 

all of

them confined in one central app. I’ve been using the winapi for
toolbars,
menu’s, dialogs etc. Everything was grand - I use my own wndproc for
handling the windows menu and whatnot and it in turn calls the
previously
stored wndproc when its done, returning control back to sdl.

Eitherway, I eventually hit a brick wall when it came to having 

edit

boxes in my custom dialogs - they wernt receiving any input from the
keyboard. Then I noticed I couldnt tab through the dialog either.
After
trying many many things I eventually ended up changing sdl itself.

Maybe its not the best way of going about this problem, but in the 

end I

edited directx5_events.c - added two new functions
SDL_RegisterUserDialog()
and SDL_UnregisterUserDialog(). They both take the HWND of an
existing
dialog and sdl stores that in a small array - then I made a change to
the
processing of messages where before continuing with normal messaging
code it
cycles through the user dialogs array and performs an
IsDialogMessage() on
it which checks if the message belongs to any of the dialogs and
dispatches
it to them if so.

Everything is actually working great and I have all the control 

and

whatnot that I would expect from my dialogs and I dont appear to of
inadvertantly broken any other part of sdl :slight_smile: Anyway, i’m just
posting this
to tell people of this change and if its any use to anyone I can
thwack the
modded code online for people to grab. In all my devving i’ve
completly
missed the CVS scene so I dunno about any of that xD

Anyway, take care
-Dave

Sorry for the 10-year necro, but did you ever post this code? I’m
running into the same trap with SDL eating my dialog messages and I’d
love to patch SDL to handle these messages with IsDialogMessage() before
it calls DispatchMessage() which current tosses dialog messages into the
bit bucket.

Thanks!
Bit