*** empty log message ***
authorSam Lantinga <slouken@libsdl.org>
Mon, 15 Nov 2004 21:11:44 +0000
changeset 975 add87cc1de0a
parent 974 b8427b5151ed
child 976 eb78bb0b715b
*** empty log message ***
src/video/windib/SDL_dibevents.c
src/video/windx5/SDL_dx5events.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);
--- 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);
+	}
 }