*** empty log message ***
authorSam Lantinga <slouken@libsdl.org>
Mon, 15 Nov 2004 21:11:44 +0000
changeset 975add87cc1de0a
parent 974 b8427b5151ed
child 976 eb78bb0b715b
*** empty log message ***
src/video/windib/SDL_dibevents.c
src/video/windx5/SDL_dx5events.c
     1.1 --- a/src/video/windib/SDL_dibevents.c	Mon Nov 15 21:09:54 2004 +0000
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Mon Nov 15 21:11:44 2004 +0000
     1.3 @@ -368,7 +368,6 @@
     1.4  	SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0);
     1.5  	if ( SDL_windowid ) {
     1.6  		SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
     1.7 -
     1.8  		if ( SDL_Window == NULL ) {
     1.9  			SDL_SetError("Couldn't get user specified window");
    1.10  			return(-1);
     2.1 --- a/src/video/windx5/SDL_dx5events.c	Mon Nov 15 21:09:54 2004 +0000
     2.2 +++ b/src/video/windx5/SDL_dx5events.c	Mon Nov 15 21:11:44 2004 +0000
     2.3 @@ -849,14 +849,16 @@
     2.4  	SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0);
     2.5  	if ( SDL_windowid ) {
     2.6  		SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
     2.7 +		if ( SDL_Window == NULL ) {
     2.8 +			SDL_SetError("Couldn't get user specified window");
     2.9 +			return(-1);
    2.10 +		}
    2.11  
    2.12  		/* DJM: we want all event's for the user specified
    2.13 -		   window to be handled by SDL.
    2.14 +			window to be handled by SDL.
    2.15  		 */
    2.16 -		if (SDL_Window) {
    2.17 -			userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC);
    2.18 -			SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage);
    2.19 -		}
    2.20 +		userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC);
    2.21 +		SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage);
    2.22  	} else {
    2.23  		SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
    2.24                          (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
    2.25 @@ -883,5 +885,9 @@
    2.26  	DX5_DInputQuit(this);
    2.27  
    2.28  	/* Destroy our window */
    2.29 -	DestroyWindow(SDL_Window);
    2.30 +	if ( SDL_windowid ) {
    2.31 +		SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc);
    2.32 +	} else {
    2.33 +		DestroyWindow(SDL_Window);
    2.34 +	}
    2.35  }