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

Method MessageHandler

SHTest/SampleFramework12/v1.04/Window.cpp:320–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320LRESULT Window::MessageHandler(HWND hWnd, uint32 uMsg, WPARAM wParam, LPARAM lParam)
321{
322 for(uint64 i = 0; i < messageCallbacks.Count(); ++i)
323 {
324 Callback callback = messageCallbacks[i];
325 MsgFunction msgFunction = callback.Function;
326 msgFunction(callback.Context, hWnd, uMsg, wParam, lParam);
327 }
328
329 switch(uMsg)
330 {
331 // Window is being destroyed
332 case WM_DESTROY:
333 ::PostQuitMessage(0);
334 return 0;
335
336 // Window is being closed
337 case WM_CLOSE:
338 {
339 DestroyWindow(hwnd);
340 return 0;
341 }
342 }
343
344 return ::DefWindowProc(hwnd, uMsg, wParam, lParam);
345}
346
347LRESULT WINAPI Window::WndProc(HWND hWnd, uint32 uMsg, WPARAM wParam, LPARAM lParam)
348{

Callers 1

WndProcMethod · 0.80

Calls 1

CountMethod · 0.80

Tested by

no test coverage detected