You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
927 B

  1. #include <windows.h>
  2. /**
  3. *Ϣ
  4. */
  5. LRESULT CALLBACK GLWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  6. {
  7. switch (msg)
  8. {
  9. case WM_CLOSE:
  10. PostQuitMessage(0);
  11. return 0;
  12. }
  13. return DefWindowProc(hwnd, msg, wParam, lParam);
  14. }
  15. INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
  16. {
  17. /*ע�ᴰ��*/
  18. WNDCLASSEX wndclass;
  19. wndclass.cbClsExtra = 0;
  20. wndclass.cbSize = sizeof(WNDCLASSEX);
  21. wndclass.cbWndExtra = 0;
  22. wndclass.hbrBackground = NULL;
  23. wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
  24. wndclass.hIcon = NULL;
  25. wndclass.hIconSm = NULL;
  26. wndclass.hInstance = hInstance;
  27. wndclass.lpfnWndProc = GLWindowProc;
  28. wndclass.lpszClassName = L"GLWindow";
  29. wndclass.lpszMenuName = NULL;
  30. wndclass.style = CS_VREDRAW | CS_HREDRAW;
  31. ATOM atom = RegisterClassEx(&wndclass);
  32. if (!atom) {
  33. MessageBox(NULL, L"Register Fail", L"Error", MB_OK);
  34. return 0;
  35. }
  36. return 0;
  37. }