MCPcopy Create free account
hub / github.com/TheRealMJP/Shadows / MessageHandler

Method MessageHandler

Shadows/SampleFramework11/Window.cpp:268–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268LRESULT Window::MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
269{
270 if(TwEventWin(hWnd, uMsg, wParam, lParam))
271 return 0;
272
273 if(messageCallbacks.find(uMsg) != messageCallbacks.end())
274 {
275 Callback callback = messageCallbacks[uMsg];
276 MsgFunction msgFunction = callback.Function;
277 return msgFunction(callback.Context, hWnd, uMsg, wParam, lParam);
278 }
279 else
280 {
281 switch (uMsg)
282 {
283 // Window is being destroyed
284 case WM_DESTROY:
285 ::PostQuitMessage(0);
286 return 0;
287
288 // Window is being closed
289 case WM_CLOSE:
290 {
291 DestroyWindow(hwnd);
292 return 0;
293 }
294 }
295 }
296
297 return ::DefWindowProc(hwnd, uMsg, wParam, lParam);
298}
299
300LRESULT WINAPI Window::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
301{

Callers 1

WndProcMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected