I want to be able to detect using events, when a Window (not necessarily the application I'm creating) changes its title.
My ideas (but none of them uses a specialized event):
- Add an event to the mouse click and keyboard strokes, that way I can detect when the title will change, but it's not perfect, since the title may change a few seconds after the last click (e.g. loading a website)
- Do some polling only on whitelisted applications
EDIT: I managed to put the EVENT_SYSTEM_CAPTURESTART
hook, which captures clicks. It does work for changing tabs, but for loading new pages, it will not capture the change because pages usually take some time to load.
SetWindowsHookEx
to interceptWM_SETTEXT
messages. But some apps have custom-drawn titles, so this is not a universal solution. – Remy Lebeau