You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
panic!("Error with `GetMessageW`, error code: {}", last_error);
1092
+
} else {
1093
+
unsafe {
1094
+
TranslateMessage(&msg);
1095
+
DispatchMessageW(&msg);
1096
+
}
1097
+
}
1098
+
}
1099
+
```
1100
+
1083
1101
There's a lot of good info on the page about window messages,
1084
1102
but that's all we have to do here in terms of our code.
1085
1103
@@ -1099,11 +1117,16 @@ However, a few event types can't just be ignored.
1099
1117
One of them is that window closing situation.
1100
1118
Another is that thing with the mouse cursor.
1101
1119
1120
+
First let's do the window closing and cleanup.
1102
1121
If we look at MSDN page for the [WM_CLOSE](https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-close)
1103
1122
message, we can see that we'll need to be able to use [DestroyWindow](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow)
1104
1123
and [PostQuitMessage](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postquitmessage).
1124
+
We also need to respond to [WM_DESTROY](https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-destroy) as well.
0 commit comments