Fixed code for building with UNICODE and without C runtime gsoc2008_force_feedback
authorSam Lantinga <slouken@libsdl.org>
Mon, 25 Aug 2008 09:58:14 +0000
branchgsoc2008_force_feedback
changeset 26497961f1f74dc8
parent 2648 6d705ec89fb6
child 2650 77b5f12bfe11
Fixed code for building with UNICODE and without C runtime
src/video/win32/SDL_win32window.c
     1.1 --- a/src/video/win32/SDL_win32window.c	Mon Aug 25 09:51:02 2008 +0000
     1.2 +++ b/src/video/win32/SDL_win32window.c	Mon Aug 25 09:58:14 2008 +0000
     1.3 @@ -32,8 +32,8 @@
     1.4  
     1.5  /* Fake window to help with DirectInput events. */
     1.6  HWND SDL_HelperWindow = NULL;
     1.7 -static const char *SDL_HelperWindowClassName = "SDLHelperWindowInputCatcher";
     1.8 -static const char *SDL_HelperWindowName = "SDLHelperWindowInputMsgWindow";
     1.9 +static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
    1.10 +static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
    1.11  static ATOM SDL_HelperWindowClass = 0;
    1.12  
    1.13  
    1.14 @@ -427,21 +427,21 @@
    1.15     WNDCLASSEX wce;
    1.16  
    1.17     /* Create the class. */
    1.18 -   ZeroMemory(&wce, sizeof (wce));
    1.19 +   SDL_zero(wce);
    1.20     wce.cbSize = sizeof(WNDCLASSEX);
    1.21     wce.lpfnWndProc = DefWindowProcA;
    1.22     wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
    1.23     wce.hInstance = hInstance;
    1.24  
    1.25     /* Register the class. */
    1.26 -   SDL_HelperWindowClass = RegisterClassExA(&wce);
    1.27 +   SDL_HelperWindowClass = RegisterClassEx(&wce);
    1.28     if (SDL_HelperWindowClass == 0) {
    1.29        SDL_SetError("Unable to create Helper Window Class: error %d.", GetLastError());
    1.30        return -1;
    1.31     }
    1.32  
    1.33     /* Create the window. */
    1.34 -   SDL_HelperWindow = CreateWindowExA(0, SDL_HelperWindowClassName,
    1.35 +   SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
    1.36           SDL_HelperWindowName, WS_OVERLAPPEDWINDOW,
    1.37           CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
    1.38           CW_USEDEFAULT, HWND_MESSAGE, NULL, hInstance, NULL);
    1.39 @@ -468,7 +468,7 @@
    1.40  
    1.41     /* Unregister the class. */
    1.42     if (SDL_HelperWindowClass) {
    1.43 -      UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
    1.44 +      UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
    1.45        SDL_HelperWindowClass = 0;
    1.46     }
    1.47  }