如何使用Win32监视窗口的位置?(How to monitor a window's position with Win32?)
我需要在许多Win32窗口上使用WPF绘制叠加层。 为了在正确的位置绘制叠加层,我需要挂钩窗口移动,但不知道如何做到这一点。 我应该关注哪个Win32调用?
I need to draw an overlay using WPF on top of a number of Win32 windows. In order to draw the overlay in the correct place, I will need to hook into the window move, but have no idea how to do this. Which Win32 calls should I be looking at?
最满意答案
SetWinEventHook
var hook = SetWinEventHook(EVENT_SYSTEM_MOVESIZESTART, EVENT_SYSTEM_MOVESIZEEND, NULL, WinEventProc, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);SetWinEventHook
var hook = SetWinEventHook(EVENT_SYSTEM_MOVESIZESTART, EVENT_SYSTEM_MOVESIZEEND, NULL, WinEventProc, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);更多推荐
发布评论