Trying to fix some issues with the Helper Window. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Mon, 04 Aug 2008 15:34:22 +0000
branchgsoc2008_force_feedback
changeset 2585 38f14c05a92c
parent 2584 e8644f625d45
child 2586 d84c99f5401e
Trying to fix some issues with the Helper Window.
src/video/win32/SDL_win32window.c
--- a/src/video/win32/SDL_win32window.c	Mon Aug 04 15:17:52 2008 +0000
+++ b/src/video/win32/SDL_win32window.c	Mon Aug 04 15:34:22 2008 +0000
@@ -32,6 +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 ATOM SDL_HelperWindowClass = 0;
 
 
@@ -422,15 +424,13 @@
 SDL_HelperWindowCreate(void)
 {
    HINSTANCE hInstance = GetModuleHandleA(NULL);
-   const char *class_name = "SDLHelperWindowInputCatcher";
-   const char *win_name = "SDLHelperWindowInputMsgWindow";
    WNDCLASSEX wce;
 
    /* Create the class. */
    ZeroMemory(&wce, sizeof (wce));
    wce.cbSize = sizeof(WNDCLASSEX);
    wce.lpfnWndProc = NULL;
-   wce.lpszClassName = (LPCWSTR) class_name;
+   wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
    wce.hInstance = hInstance;
 
    /* Register the class. */
@@ -441,7 +441,8 @@
    }
 
    /* Create the window. */
-   SDL_HelperWindow = CreateWindowExA(0, class_name, win_name, WS_OVERLAPPEDWINDOW,
+   SDL_HelperWindow = CreateWindowExA(0, SDL_HelperWindowClassName,
+         SDL_HelperWindowName, WS_OVERLAPPEDWINDOW,
          CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
          CW_USEDEFAULT, HWND_MESSAGE, NULL, hInstance, NULL);
    if (SDL_HelperWindow == NULL) {
@@ -467,7 +468,7 @@
 
    /* Unregister the class. */
    if (SDL_HelperWindowClass) {
-      UnregisterClassA(SDL_HelperWindowClass, GetModuleHandleA(NULL));
+      UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
       SDL_HelperWindowClass = 0;
    }
 }