diff src/video/win32/SDL_win32window.c @ 2649:7961f1f74dc8 gsoc2008_force_feedback

Fixed code for building with UNICODE and without C runtime
author Sam Lantinga <slouken@libsdl.org>
date Mon, 25 Aug 2008 09:58:14 +0000
parents d84c99f5401e
children
line wrap: on
line diff
--- a/src/video/win32/SDL_win32window.c	Mon Aug 25 09:51:02 2008 +0000
+++ b/src/video/win32/SDL_win32window.c	Mon Aug 25 09:58:14 2008 +0000
@@ -32,8 +32,8 @@
 
 /* Fake window to help with DirectInput events. */
 HWND SDL_HelperWindow = NULL;
-static const char *SDL_HelperWindowClassName = "SDLHelperWindowInputCatcher";
-static const char *SDL_HelperWindowName = "SDLHelperWindowInputMsgWindow";
+static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
+static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
 static ATOM SDL_HelperWindowClass = 0;
 
 
@@ -427,21 +427,21 @@
    WNDCLASSEX wce;
 
    /* Create the class. */
-   ZeroMemory(&wce, sizeof (wce));
+   SDL_zero(wce);
    wce.cbSize = sizeof(WNDCLASSEX);
    wce.lpfnWndProc = DefWindowProcA;
    wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
    wce.hInstance = hInstance;
 
    /* Register the class. */
-   SDL_HelperWindowClass = RegisterClassExA(&wce);
+   SDL_HelperWindowClass = RegisterClassEx(&wce);
    if (SDL_HelperWindowClass == 0) {
       SDL_SetError("Unable to create Helper Window Class: error %d.", GetLastError());
       return -1;
    }
 
    /* Create the window. */
-   SDL_HelperWindow = CreateWindowExA(0, SDL_HelperWindowClassName,
+   SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
          SDL_HelperWindowName, WS_OVERLAPPEDWINDOW,
          CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
          CW_USEDEFAULT, HWND_MESSAGE, NULL, hInstance, NULL);
@@ -468,7 +468,7 @@
 
    /* Unregister the class. */
    if (SDL_HelperWindowClass) {
-      UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
+      UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
       SDL_HelperWindowClass = 0;
    }
 }