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?
Asked
Active
Viewed 346 times
2
-
WPF ? WinForms ? imho you might want to say a bit more about what you mean by "contents ... changed" : 1. does a change in Form Size or Location count ? 2. change in FormWindowState count ? 3. do you mean that some setting of some control on a Form (like the selected item in a ListView) has changed, some text has been altered in a TextBox ? 4. If I click a button (assuming the result of the button click makes no change in the visual appearance of the form) is that a "change" ? Or ... ? – BillW Feb 03 '10 at 23:28
1 Answers
1
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)

John Knoeller
- 33,512
- 4
- 61
- 92