Commit f5b01b1d authored by Sam Lantinga's avatar Sam Lantinga

Restore the user specified window proc after shutdown

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40975
parent 06423668
...@@ -369,13 +369,16 @@ int DIB_CreateWindow(_THIS) ...@@ -369,13 +369,16 @@ int DIB_CreateWindow(_THIS)
if ( SDL_windowid ) { if ( SDL_windowid ) {
SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0); SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
/* DJM: we want all event's for the user specified if ( SDL_Window == NULL ) {
window to be handled by SDL. SDL_SetError("Couldn't get user specified window");
*/ return(-1);
if (SDL_Window) { }
userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC);
SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); /* DJM: we want all event's for the user specified
} window to be handled by SDL.
*/
userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC);
SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage);
} else { } else {
SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
(WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
...@@ -391,7 +394,9 @@ int DIB_CreateWindow(_THIS) ...@@ -391,7 +394,9 @@ int DIB_CreateWindow(_THIS)
void DIB_DestroyWindow(_THIS) void DIB_DestroyWindow(_THIS)
{ {
if ( SDL_windowid == NULL ) { if ( SDL_windowid ) {
SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc);
} else {
DestroyWindow(SDL_Window); DestroyWindow(SDL_Window);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment