Created
May 25, 2024 02:12
Revisions
-
Acebond created this gist
May 25, 2024 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,69 @@ #include <Windows.h> LRESULT CALLBACK WndProc( _In_ HWND hWnd, _In_ UINT msg, _In_ WPARAM wParam, _In_ LPARAM lParam) { switch (msg) { case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } int APIENTRY wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow) { const TCHAR szTitle[] = TEXT("Example Windows App"); const TCHAR szWindowClass[] = TEXT("Example Windows App"); WNDCLASSEX wc = { .cbSize = sizeof(wc), .lpfnWndProc = WndProc, .hInstance = hInstance, .lpszClassName = szWindowClass, }; if (!RegisterClassEx(&wc)) { return 1; } HWND hWnd = CreateWindowEx( 0, // No extended style szWindowClass, // Class name szTitle, // Window title WS_OVERLAPPEDWINDOW, // Window style CW_USEDEFAULT, // Initial x position CW_USEDEFAULT, // Initial y position 1280, // Width 720, // Height nullptr, // No parent window nullptr, // No menu wc.hInstance, // Instance handle nullptr); // No additional data if (!hWnd) { return 1; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); MSG msg; while (GetMessage(&msg, nullptr, 0, 0) > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } DestroyWindow(hWnd); UnregisterClass(wc.lpszClassName, wc.hInstance); return 0; }