test/testnativew32.c
changeset 3071 6f3308d4b6cd
parent 3060 4cf533f434d8
child 5062 e8916fe9cfc8
     1.1 --- a/test/testnativew32.c	Tue Feb 17 05:44:49 2009 +0000
     1.2 +++ b/test/testnativew32.c	Tue Feb 17 05:57:54 2009 +0000
     1.3 @@ -12,18 +12,18 @@
     1.4      DestroyWindowWin32
     1.5  };
     1.6  
     1.7 -LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
     1.8 +LRESULT CALLBACK
     1.9 +WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    1.10  {
    1.11 -    switch(msg)
    1.12 -    {
    1.13 -        case WM_CLOSE:
    1.14 -            DestroyWindow(hwnd);
    1.15 +    switch (msg) {
    1.16 +    case WM_CLOSE:
    1.17 +        DestroyWindow(hwnd);
    1.18          break;
    1.19 -        case WM_DESTROY:
    1.20 -            PostQuitMessage(0);
    1.21 +    case WM_DESTROY:
    1.22 +        PostQuitMessage(0);
    1.23          break;
    1.24 -        default:
    1.25 -            return DefWindowProc(hwnd, msg, wParam, lParam);
    1.26 +    default:
    1.27 +        return DefWindowProc(hwnd, msg, wParam, lParam);
    1.28      }
    1.29      return 0;
    1.30  }
    1.31 @@ -34,29 +34,30 @@
    1.32      HWND hwnd;
    1.33      WNDCLASS wc;
    1.34  
    1.35 -    wc.style         = 0;
    1.36 -    wc.lpfnWndProc   = WndProc;
    1.37 -    wc.cbClsExtra    = 0;
    1.38 -    wc.cbWndExtra    = 0;
    1.39 -    wc.hInstance     = GetModuleHandle(NULL);
    1.40 -    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    1.41 -    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    1.42 -    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    1.43 -    wc.lpszMenuName  = NULL;
    1.44 +    wc.style = 0;
    1.45 +    wc.lpfnWndProc = WndProc;
    1.46 +    wc.cbClsExtra = 0;
    1.47 +    wc.cbWndExtra = 0;
    1.48 +    wc.hInstance = GetModuleHandle(NULL);
    1.49 +    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    1.50 +    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    1.51 +    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
    1.52 +    wc.lpszMenuName = NULL;
    1.53      wc.lpszClassName = "SDL Test";
    1.54  
    1.55 -    if(!RegisterClass(&wc))
    1.56 -    {
    1.57 +    if (!RegisterClass(&wc)) {
    1.58          MessageBox(NULL, "Window Registration Failed!", "Error!",
    1.59 -            MB_ICONEXCLAMATION | MB_OK);
    1.60 +                   MB_ICONEXCLAMATION | MB_OK);
    1.61          return 0;
    1.62      }
    1.63  
    1.64 -    hwnd = CreateWindow("SDL Test", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL), NULL);
    1.65 -    if(hwnd == NULL)
    1.66 -    {
    1.67 +    hwnd =
    1.68 +        CreateWindow("SDL Test", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
    1.69 +                     CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL),
    1.70 +                     NULL);
    1.71 +    if (hwnd == NULL) {
    1.72          MessageBox(NULL, "Window Creation Failed!", "Error!",
    1.73 -            MB_ICONEXCLAMATION | MB_OK);
    1.74 +                   MB_ICONEXCLAMATION | MB_OK);
    1.75          return 0;
    1.76      }
    1.77  
    1.78 @@ -68,7 +69,7 @@
    1.79  static void
    1.80  DestroyWindowWin32(void *window)
    1.81  {
    1.82 -    DestroyWindow((HWND)window);
    1.83 +    DestroyWindow((HWND) window);
    1.84  }
    1.85  
    1.86  #endif