comparison src/video/win32/SDL_win32window.c @ 4500:eff4e88cc1e8

Added Windows clipboard support
author Sam Lantinga <slouken@libsdl.org>
date Thu, 08 Jul 2010 05:43:34 -0700
parents 237b1eb53e4d
children e1664f94f026 03dcb795c583 436183eb30c8
comparison
equal deleted inserted replaced
4499:c2ebe3e020c6 4500:eff4e88cc1e8
631 wce.hInstance = hInstance; 631 wce.hInstance = hInstance;
632 632
633 /* Register the class. */ 633 /* Register the class. */
634 SDL_HelperWindowClass = RegisterClass(&wce); 634 SDL_HelperWindowClass = RegisterClass(&wce);
635 if (SDL_HelperWindowClass == 0) { 635 if (SDL_HelperWindowClass == 0) {
636 SDL_SetError("Unable to create Helper Window Class: error %d.", 636 WIN_SetError("Unable to create Helper Window Class");
637 GetLastError());
638 return -1; 637 return -1;
639 } 638 }
640 639
641 #ifndef _WIN32_WCE 640 #ifndef _WIN32_WCE
642 /* WinCE doesn't have HWND_MESSAGE */ 641 /* WinCE doesn't have HWND_MESSAGE */
650 CW_USEDEFAULT, CW_USEDEFAULT, 649 CW_USEDEFAULT, CW_USEDEFAULT,
651 CW_USEDEFAULT, hWndParent, NULL, 650 CW_USEDEFAULT, hWndParent, NULL,
652 hInstance, NULL); 651 hInstance, NULL);
653 if (SDL_HelperWindow == NULL) { 652 if (SDL_HelperWindow == NULL) {
654 UnregisterClass(SDL_HelperWindowClassName, hInstance); 653 UnregisterClass(SDL_HelperWindowClassName, hInstance);
655 SDL_SetError("Unable to create Helper Window: error %d.", 654 WIN_SetError("Unable to create Helper Window");
656 GetLastError());
657 return -1; 655 return -1;
658 } 656 }
659 657
660 return 0; 658 return 0;
661 } 659 }
670 HINSTANCE hInstance = GetModuleHandle(NULL); 668 HINSTANCE hInstance = GetModuleHandle(NULL);
671 669
672 /* Destroy the window. */ 670 /* Destroy the window. */
673 if (SDL_HelperWindow != NULL) { 671 if (SDL_HelperWindow != NULL) {
674 if (DestroyWindow(SDL_HelperWindow) == 0) { 672 if (DestroyWindow(SDL_HelperWindow) == 0) {
675 SDL_SetError("Unable to destroy Helper Window: error %d.", 673 WIN_SetError("Unable to destroy Helper Window");
676 GetLastError());
677 return; 674 return;
678 } 675 }
679 SDL_HelperWindow = NULL; 676 SDL_HelperWindow = NULL;
680 } 677 }
681 678
682 /* Unregister the class. */ 679 /* Unregister the class. */
683 if (SDL_HelperWindowClass != 0) { 680 if (SDL_HelperWindowClass != 0) {
684 if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) { 681 if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) {
685 SDL_SetError("Unable to destroy Helper Window Class: error %d.", 682 WIN_SetError("Unable to destroy Helper Window Class");
686 GetLastError());
687 return; 683 return;
688 } 684 }
689 SDL_HelperWindowClass = 0; 685 SDL_HelperWindowClass = 0;
690 } 686 }
691 } 687 }