changeset 2585:38f14c05a92c gsoc2008_force_feedback

Trying to fix some issues with the Helper Window.
author Edgar Simo <bobbens@gmail.com>
date Mon, 04 Aug 2008 15:34:22 +0000
parents e8644f625d45
children d84c99f5401e
files src/video/win32/SDL_win32window.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
    }
 }