Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Trying to fix some issues with the Helper Window.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 4, 2008
1 parent 4c95595 commit a080a99
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/video/win32/SDL_win32window.c
Expand Up @@ -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;


Expand Down Expand Up @@ -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. */
Expand All @@ -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) {
Expand All @@ -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;
}
}
Expand Down

0 comments on commit a080a99

Please sign in to comment.