Advertisement
minilose

Untitled

Mar 29th, 2022
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.44 KB | None | 0 0
  1. LRESULT CALLBACK    WndProc
  2. (
  3.     HWND                hWnd,
  4.     UINT                message,
  5.     WPARAM              wParam,
  6.     LPARAM              lParam
  7. )
  8. {
  9.     int                 wmId, wmEvent;
  10.     PAINTSTRUCT         ps;
  11.     HDC                 hdc;
  12.     static unsigned int total_count_child = 0;
  13.     static unsigned int move_count_child = 0;
  14.     static unsigned int rclick_count_child = 0;
  15.     static unsigned int mclick_count_child = 0;
  16.     static unsigned int lclick_count_child = 0;
  17.     total_count_child++;
  18.     TCHAR Тoutput[100];
  19.     WCHAR Woutput[100];
  20.     char output[100];
  21.     char movem[100];
  22.     switch (message)
  23.     {
  24.     case WM_COMMAND:
  25.         wmId = LOWORD(wParam);
  26.         wmEvent = HIWORD(wParam);
  27.         switch (wmId)
  28.         {
  29.         case IDM_ABOUT:
  30.             DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
  31.             break;
  32.         case IDM_EXIT:
  33.             DestroyWindow(hWnd);
  34.             break;
  35.         default:
  36.             return DefWindowProc(hWnd, message, wParam, lParam);
  37.         }
  38.         break;
  39.     case WM_PAINT:
  40.         hdc = BeginPaint(hWnd, &ps);
  41.         EndPaint(hWnd, &ps);
  42.         break;
  43.     case WM_DESTROY:
  44.         _stprintf(Тoutput, _T("\n\n======CHILD======\n\nОбщо = %u , Move = %lu, Rclk = %u , Mclk = %u, Lclk = %hu\n"), total_count_child, move_count_child, rclick_count_child, mclick_count_child, lclick_count_child);
  45.         OutputDebugString(Тoutput);
  46.         _stprintf(Тoutput, _T("Total = %u , Move = %lu, Rclk = %u , Mclk = %u, Lclk = %hu\n"), total_count_child, move_count_child, rclick_count_child, mclick_count_child, lclick_count_child);
  47.         OutputDebugString(Тoutput);
  48.         sprintf(output, "Total = %u , Move = %lu, Rclk = %u , Mclk = %u, Lclk = %hu\n", total_count_child, move_count_child, rclick_count_child, mclick_count_child, lclick_count_child);
  49.         OutputDebugStringA(output);
  50.         swprintf(Woutput, sizeof(Woutput), L"Общо = %u , Move = %lu, Rclk = %u , Mclk = %u, Lclk = %hu\n", total_count_child, move_count_child, rclick_count_child, mclick_count_child, lclick_count_child);
  51.         OutputDebugStringW(Woutput);
  52.         PostQuitMessage(0);
  53.         break;
  54.     case WM_MOUSEMOVE:
  55.         move_count_child++;
  56.         sprintf(movem, "move = %u\n", move_count_child);
  57.         OutputDebugStringA(movem);
  58.         return DefWindowProc(hWnd, message, wParam, lParam);
  59.         break;
  60.     case WM_LBUTTONDOWN:
  61.         lclick_count_child++;return DefWindowProc(hWnd, message, wParam, lParam);break;
  62.     case WM_RBUTTONDOWN:
  63.         rclick_count_child++;return DefWindowProc(hWnd, message, wParam, lParam);break;
  64.     case WM_MBUTTONDOWN:
  65.         mclick_count_child++;return DefWindowProc(hWnd, message, wParam, lParam);break;
  66.     default:
  67.         return DefWindowProc(hWnd, message, wParam, lParam);
  68.     }
  69.     return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement