From a080a99fa7d9ab66ee9343d3202d0a1855c11a8b Mon Sep 17 00:00:00 2001 From: Edgar Simo Date: Mon, 4 Aug 2008 15:34:22 +0000 Subject: [PATCH] Trying to fix some issues with the Helper Window. --- src/video/win32/SDL_win32window.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/video/win32/SDL_win32window.c b/src/video/win32/SDL_win32window.c index f61327f9a..60fcea617 100644 --- a/src/video/win32/SDL_win32window.c +++ b/src/video/win32/SDL_win32window.c @@ -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 @@ int 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 @@ SDL_HelperWindowCreate(void) } /* 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 @@ SDL_HelperWindowDestroy(void) /* Unregister the class. */ if (SDL_HelperWindowClass) { - UnregisterClassA(SDL_HelperWindowClass, GetModuleHandleA(NULL)); + UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL)); SDL_HelperWindowClass = 0; } }