开发者

detecting window text change with pinvoke

开发者 https://www.devze.com 2022-12-18 20:51 出处:网络
Is there any way to see if the contents of a \'window\' have changed, that is referenced only by a handle? Such as one obtained from a pinvoke开发者_如何学编程 FindWindow? If you want to be notified t

Is there any way to see if the contents of a 'window' have changed, that is referenced only by a handle? Such as one obtained from a pinvoke开发者_如何学编程 FindWindow?


If you want to be notified that the text changed, then no. Some windows send notifications of changes to their parent windows, but you would have to be in the process to intercept those messages, and not all windows even send notifications. (I presume by the fact that you are using FindWindow that you are not in-process)

If you want to get the text and check for yoursef, you can do that with a pinvoke to GetWindowText or to SendMessage(hwnd, WM_GETTEXT, ...); (GetWindowText is just a helpful wrapper around a SendMessage)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号