Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_sysevents.c @ 453:a6fa62b1be09
Updated for embedded Visual C++ 4.0
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 20 Aug 2002 00:20:06 +0000 |
parents | 24edec3cafe4 |
children | d0ab9718bf91 |
comparison
equal
deleted
inserted
replaced
452:4c5c10383201 | 453:a6fa62b1be09 |
---|---|
45 #include "wmmsg.h" | 45 #include "wmmsg.h" |
46 #endif | 46 #endif |
47 | 47 |
48 #ifdef _WIN32_WCE | 48 #ifdef _WIN32_WCE |
49 #define NO_GETKEYBOARDSTATE | 49 #define NO_GETKEYBOARDSTATE |
50 #define NO_CHANGEDISPLAYSETTINGS | |
50 #endif | 51 #endif |
51 | 52 |
52 /* The window we use for everything... */ | 53 /* The window we use for everything... */ |
53 const char *SDL_Appname = NULL; | 54 #ifdef _WIN32_WCE |
55 LPWSTR SDL_Appname = NULL; | |
56 #else | |
57 LPSTR SDL_Appname = NULL; | |
58 #endif | |
54 HINSTANCE SDL_Instance = NULL; | 59 HINSTANCE SDL_Instance = NULL; |
55 HWND SDL_Window = NULL; | 60 HWND SDL_Window = NULL; |
56 RECT SDL_bounds = {0, 0, 0, 0}; | 61 RECT SDL_bounds = {0, 0, 0, 0}; |
57 int SDL_resizing = 0; | 62 int SDL_resizing = 0; |
58 int mouse_relative = 0; | 63 int mouse_relative = 0; |
576 | 581 |
577 /* Register the application class */ | 582 /* Register the application class */ |
578 class.hCursor = NULL; | 583 class.hCursor = NULL; |
579 #ifdef _WIN32_WCE | 584 #ifdef _WIN32_WCE |
580 { | 585 { |
581 /* WinCE uses the UNICODE version */ | 586 /* WinCE uses the UNICODE version */ |
582 int nLen = strlen(name)+1; | 587 int nLen = strlen(name)+1; |
583 LPWSTR lpszW = alloca(nLen*2); | 588 SDL_Appname = malloc(nLen*2); |
584 MultiByteToWideChar(CP_ACP, 0, name, -1, lpszW, nLen); | 589 MultiByteToWideChar(CP_ACP, 0, name, -1, SDL_Appname, nLen); |
585 class.hIcon = LoadImage(hInst, lpszW, IMAGE_ICON, | 590 } |
591 #else | |
592 { | |
593 int nLen = strlen(name)+1; | |
594 SDL_Appname = malloc(nLen); | |
595 strcpy(SDL_Appname, name); | |
596 } | |
597 #endif /* _WIN32_WCE */ | |
598 class.hIcon = LoadImage(hInst, SDL_Appname, IMAGE_ICON, | |
586 0, 0, LR_DEFAULTCOLOR); | 599 0, 0, LR_DEFAULTCOLOR); |
587 class.lpszMenuName = NULL; | 600 class.lpszMenuName = NULL; |
588 class.lpszClassName = lpszW; | 601 class.lpszClassName = SDL_Appname; |
589 } | |
590 #else | |
591 class.hIcon = LoadImage(hInst, name, IMAGE_ICON, | |
592 0, 0, LR_DEFAULTCOLOR); | |
593 class.lpszMenuName = "(none)"; | |
594 class.lpszClassName = name; | |
595 #endif /* _WIN32_WCE */ | |
596 class.hbrBackground = NULL; | 602 class.hbrBackground = NULL; |
597 class.hInstance = hInst; | 603 class.hInstance = hInst; |
598 class.style = style; | 604 class.style = style; |
599 #ifdef HAVE_OPENGL | 605 #ifdef HAVE_OPENGL |
600 class.style |= CS_OWNDC; | 606 class.style |= CS_OWNDC; |
604 class.cbClsExtra = 0; | 610 class.cbClsExtra = 0; |
605 if ( ! RegisterClass(&class) ) { | 611 if ( ! RegisterClass(&class) ) { |
606 SDL_SetError("Couldn't register application class"); | 612 SDL_SetError("Couldn't register application class"); |
607 return(-1); | 613 return(-1); |
608 } | 614 } |
609 SDL_Appname = name; | |
610 SDL_Instance = hInst; | 615 SDL_Instance = hInst; |
611 | 616 |
612 #ifdef WM_MOUSELEAVE | 617 #ifdef WM_MOUSELEAVE |
613 /* Get the version of TrackMouseEvent() we use */ | 618 /* Get the version of TrackMouseEvent() we use */ |
614 _TrackMouseEvent = NULL; | 619 _TrackMouseEvent = NULL; |