# HG changeset patch # User Sam Lantinga # Date 1100553104 0 # Node ID add87cc1de0a993a54b541391638028f4f826c5d # Parent b8427b5151ed27075a761ba14aebf04438df843e *** empty log message *** diff -r b8427b5151ed -r add87cc1de0a src/video/windib/SDL_dibevents.c --- a/src/video/windib/SDL_dibevents.c Mon Nov 15 21:09:54 2004 +0000 +++ b/src/video/windib/SDL_dibevents.c Mon Nov 15 21:11:44 2004 +0000 @@ -368,7 +368,6 @@ SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0); if ( SDL_windowid ) { SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0); - if ( SDL_Window == NULL ) { SDL_SetError("Couldn't get user specified window"); return(-1); diff -r b8427b5151ed -r add87cc1de0a src/video/windx5/SDL_dx5events.c --- a/src/video/windx5/SDL_dx5events.c Mon Nov 15 21:09:54 2004 +0000 +++ b/src/video/windx5/SDL_dx5events.c Mon Nov 15 21:11:44 2004 +0000 @@ -849,14 +849,16 @@ SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0); if ( SDL_windowid ) { SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0); + if ( SDL_Window == NULL ) { + SDL_SetError("Couldn't get user specified window"); + return(-1); + } /* DJM: we want all event's for the user specified - window to be handled by SDL. + window to be handled by SDL. */ - if (SDL_Window) { - userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC); - SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); - } + userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC); + SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); } else { SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), @@ -883,5 +885,9 @@ DX5_DInputQuit(this); /* Destroy our window */ - DestroyWindow(SDL_Window); + if ( SDL_windowid ) { + SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc); + } else { + DestroyWindow(SDL_Window); + } }