comparison src/video/win32/SDL_win32window.c @ 2714:1d1be6137875

Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
author Sam Lantinga <slouken@libsdl.org>
date Mon, 25 Aug 2008 10:04:06 +0000
parents 0906692aa6a4
children 0e2b65f32298
comparison
equal deleted inserted replaced
2713:0906692aa6a4 2714:1d1be6137875
47 extern HCTX *g_hCtx; /* the table of tablet event contexts, each windows has to have it's own tablet context */ 47 extern HCTX *g_hCtx; /* the table of tablet event contexts, each windows has to have it's own tablet context */
48 int highestId = 0; /* the highest id of the tablet context */ 48 int highestId = 0; /* the highest id of the tablet context */
49 49
50 /* Fake window to help with DirectInput events. */ 50 /* Fake window to help with DirectInput events. */
51 HWND SDL_HelperWindow = NULL; 51 HWND SDL_HelperWindow = NULL;
52 static const char *SDL_HelperWindowClassName = "SDLHelperWindowInputCatcher"; 52 static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
53 static const char *SDL_HelperWindowName = "SDLHelperWindowInputMsgWindow"; 53 static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
54 static ATOM SDL_HelperWindowClass = 0; 54 static ATOM SDL_HelperWindowClass = 0;
55 55
56 static int 56 static int
57 SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) 57 SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
58 { 58 {
485 { 485 {
486 HINSTANCE hInstance = GetModuleHandleA(NULL); 486 HINSTANCE hInstance = GetModuleHandleA(NULL);
487 WNDCLASSEX wce; 487 WNDCLASSEX wce;
488 488
489 /* Create the class. */ 489 /* Create the class. */
490 SDL_memset(&wce, 0, sizeof(wce)); 490 SDL_zero(wce);
491 wce.cbSize = sizeof(WNDCLASSEX); 491 wce.cbSize = sizeof(WNDCLASSEX);
492 wce.lpfnWndProc = DefWindowProcA; 492 wce.lpfnWndProc = DefWindowProcA;
493 wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName; 493 wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
494 wce.hInstance = hInstance; 494 wce.hInstance = hInstance;
495 495
496 /* Register the class. */ 496 /* Register the class. */
497 SDL_HelperWindowClass = RegisterClassExA(&wce); 497 SDL_HelperWindowClass = RegisterClassEx(&wce);
498 if (SDL_HelperWindowClass == 0) { 498 if (SDL_HelperWindowClass == 0) {
499 SDL_SetError("Unable to create Helper Window Class: error %d.", 499 SDL_SetError("Unable to create Helper Window Class: error %d.",
500 GetLastError()); 500 GetLastError());
501 return -1; 501 return -1;
502 } 502 }
503 503
504 /* Create the window. */ 504 /* Create the window. */
505 SDL_HelperWindow = CreateWindowExA(0, SDL_HelperWindowClassName, 505 SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
506 SDL_HelperWindowName, 506 SDL_HelperWindowName,
507 WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 507 WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
508 CW_USEDEFAULT, CW_USEDEFAULT, 508 CW_USEDEFAULT, CW_USEDEFAULT,
509 CW_USEDEFAULT, HWND_MESSAGE, NULL, 509 CW_USEDEFAULT, HWND_MESSAGE, NULL,
510 hInstance, NULL); 510 hInstance, NULL);
511 if (SDL_HelperWindow == NULL) { 511 if (SDL_HelperWindow == NULL) {
512 SDL_SetError("Unable to create Helper Window: error %d.", 512 SDL_SetError("Unable to create Helper Window: error %d.",
513 GetLastError()); 513 GetLastError());
514 return -1; 514 return -1;
515 } 515 }
530 SDL_HelperWindow = NULL; 530 SDL_HelperWindow = NULL;
531 } 531 }
532 532
533 /* Unregister the class. */ 533 /* Unregister the class. */
534 if (SDL_HelperWindowClass) { 534 if (SDL_HelperWindowClass) {
535 UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL)); 535 UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
536 SDL_HelperWindowClass = 0; 536 SDL_HelperWindowClass = 0;
537 } 537 }
538 } 538 }
539 539
540 540