Original Post
I'm trying to start a timer when the user starts to drag the window, so I can render a frame on the WM_TIMER message, to prevent the stall that happens when the user drags the window. I added some logging and found that DefWindowProc() for WM_SYSCOMMAND (With a wParam of 0xf012, which doesn't seem to be a recognised SC_* value) and WM_NCLBUTTONDOWN takes a considerable time to return (Over 500ms). With some more logging, it seems that WM_NCLBUTTONDOWN comes first, and calling DefWindowProc causes a WM_SYSCOMMAND message to be sent (So it's recursing into the window proc, hence the delay on both messages). The call stack at the time if I break with F12 isn't very exciting: Obviously returning 0 from WM_NCLBUTTONDOWN doesn't cause WM_SYSCOMMAND to be sent, and no delay, but it also prevents the window from being moved. So, does anyone know what's going on here and if there's any way of stopping it? Cheers, Steve
ntdll.dll!_KiFastSystemCallRet@0()
user32.dll!_NtUserMessageCall@28() + 0xc bytes
user32.dll!_RealDefWindowProcWorker@20() - 0x79d6 bytes
user32.dll!_RealDefWindowProcW@16() + 0x27 bytes
uxtheme.dll!DoMsgDefault() + 0x29 bytes
uxtheme.dll!OnDwpSysCommand() + 0x29 bytes
uxtheme.dll!_ThemeDefWindowProc() + 0x61a8 bytes
uxtheme.dll!_ThemeDefWindowProcW@16() + 0x18 bytes
user32.dll!_DefWindowProcW@16() + 0x815 bytes
> Tutorial02.exe!D3DWindow::WndProc(unsigned int uMsg=274, unsigned int wParam=61458, long lParam=5636612) Line 227 + 0x1b bytes C++
Tutorial02.exe!D3DWindow::StaticWndProc(HWND__ * hWnd=0x000a06fa, unsigned int uMsg=274, unsigned int wParam=61458, long lParam=5636612) Line 169 + 0x1a bytes C++
user32.dll!_InternalCallWinProc@20() + 0x23 bytes
user32.dll!_UserCallWinProcCheckWow@32() - 0xddcf bytes
user32.dll!_DispatchClientMessage@20() + 0x4b bytes
user32.dll!___fnDWORD@4() + 0x24 bytes
ntdll.dll!_KiUserCallbackDispatcher@12() + 0x2e bytes
user32.dll!_NtUserMessageCall@28() + 0xc bytes
user32.dll!_RealDefWindowProcWorker@20() - 0x79d6 bytes
user32.dll!_RealDefWindowProcW@16() + 0x27 bytes
uxtheme.dll!DoMsgDefault() + 0x29 bytes
uxtheme.dll!OnDwpNcLButtonDown() + 0x32 bytes
uxtheme.dll!_ThemeDefWindowProc() + 0x61a8 bytes
uxtheme.dll!_ThemeDefWindowProcW@16() + 0x18 bytes
user32.dll!_DefWindowProcW@16() + 0x815 bytes
Tutorial02.exe!D3DWindow::WndProc(unsigned int uMsg=161, unsigned int wParam=2, long lParam=5636612) Line 227 + 0x1b bytes C++
Tutorial02.exe!D3DWindow::StaticWndProc(HWND__ * hWnd=0x000a06fa, unsigned int uMsg=161, unsigned int wParam=2, long lParam=5636612) Line 169 + 0x1a bytes C++
user32.dll!_InternalCallWinProc@20() + 0x23 bytes
user32.dll!_UserCallWinProcCheckWow@32() + 0xb3 bytes
user32.dll!_DispatchMessageWorker@8() + 0xe6 bytes
user32.dll!_DispatchMessageW@4() + 0xf bytes
Tutorial02.exe!WinMain(HINSTANCE__ * hInstance=0x009f0000, HINSTANCE__ * __formal=0x00000000, HINSTANCE__ * __formal=0x00000000, HINSTANCE__ * __formal=0x00000000) Line 22 + 0xf bytes C++
Tutorial02.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
Tutorial02.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!@BaseThreadInitThunk@12() + 0x12 bytes
ntdll.dll!___RtlUserThreadStart@8() + 0x27 bytes
ntdll.dll!__RtlUserThreadStart@8() + 0x1b bytes