src/video/windib/SDL_dibevents.c
changeset 1152 51a8702d8ecd
parent 1048 a78acdd4967e
child 1251 86d0d01290ea
     1.1 --- a/src/video/windib/SDL_dibevents.c	Wed Sep 28 11:36:20 2005 +0000
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Thu Sep 29 09:43:00 2005 +0000
     1.3 @@ -360,12 +360,25 @@
     1.4  
     1.5  int DIB_CreateWindow(_THIS)
     1.6  {
     1.7 +#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
     1.8 +	wchar_t *SDL_windowid_t;
     1.9 +#endif
    1.10 +
    1.11  #ifndef CS_BYTEALIGNCLIENT
    1.12  #define CS_BYTEALIGNCLIENT	0
    1.13  #endif
    1.14  	SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0);
    1.15  	if ( SDL_windowid ) {
    1.16 +
    1.17 +// wince 2.1 does not have strtol
    1.18 +#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
    1.19 +		SDL_windowid_t = malloc((strlen(SDL_windowid) + 1) * sizeof(wchar_t));
    1.20 +		MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, SDL_windowid, -1, SDL_windowid_t, strlen(SDL_windowid) + 1);
    1.21 +		SDL_Window = (HWND)wcstol(SDL_windowid_t, NULL, 0);
    1.22 +		free(SDL_windowid_t);
    1.23 +#else
    1.24  		SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
    1.25 +#endif
    1.26  		if ( SDL_Window == NULL ) {
    1.27  			SDL_SetError("Couldn't get user specified window");
    1.28  			return(-1);