Skip to content

Commit 7acc116

Browse files
authored
example: closes win32 window properly in WGL example (#504)
Window did not respond properly to closing via the 'x' button. Tested on Windows 10.
1 parent f492295 commit 7acc116

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

example/c/wgl.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
158158
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
159159
switch (uMsg) {
160160
case WM_QUIT:
161-
case WM_DESTROY:
162161
case WM_CLOSE:
162+
DestroyWindow(hWnd);
163+
break;
164+
case WM_DESTROY:
163165
PostQuitMessage(0);
164166
break;
165167
default:

0 commit comments

Comments
 (0)