如何使用Win32监视窗口的位置?(How to monitor a window's position with Win32?)

编程入门 行业动态 更新时间:2024-10-28 08:17:00
如何使用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);

更多推荐

本文发布于:2023-08-06 00:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1441080.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   窗口   位置   position   monitor

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!