diff --git a/example/test.cpp b/example/test.cpp deleted file mode 100644 index 2c8e707..0000000 --- a/example/test.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef UNICODE -#define UNICODE -#endif - -#include - -#pragma comment(lib, "user32.lib") - -LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - -int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow) -{ - - const wchar_t CLASS_NAME[] = L"Mica Window Class"; - - WNDCLASS wc = { }; - - wc.lpfnWndProc = WindowProc; - wc.hInstance = hInstance; - wc.lpszClassName = CLASS_NAME; - - RegisterClass(&wc); - - HWND hwnd = CreateWindowEx( - NULL, - CLASS_NAME, - L"Win32 Application", - WS_OVERLAPPEDWINDOW, - - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - - NULL, - NULL, - hInstance, - NULL - ); - - if (hwnd == NULL) - { - return 0; - } - - ShowWindow(hwnd, nCmdShow); - - MSG msg = { }; - while (GetMessage(&msg, NULL, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - return 0; -} - -LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) - { - case WM_DESTROY: - PostQuitMessage(0); - return 0; - - case WM_PAINT: - { - PAINTSTRUCT ps; - HDC hdc = BeginPaint(hwnd, &ps); - - FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1)); - EndPaint(hwnd, &ps); - } - return 0; - } - return DefWindowProc(hwnd, uMsg, wParam, lParam); -}