Trap window activation and get title

  • Thread starter Thread starter Geoff Blood
  • Start date Start date
G

Geoff Blood

I've read a lot about hooks and windows messging, but can't seem to get my
hands around it. I need a reliable way to "trap" the creation of each
window, and determine that window's title. What's the best way to do that?

TIA,
Geoff
 
Geoff Blood said:
I've read a lot about hooks and windows messging, but can't seem to get my
hands around it. I need a reliable way to "trap" the creation of each
window, and determine that window's title. What's the best way to do
that?

You can do that using a Win32 hook ('WH_SHELL', for example). However, note
that system-wide hooks (except low-level mouse and keyboard hooks) cannot be
created using VB.NET. You'll have to use C or another lightweight unmanaged
programming language for this purpose and send data from the hook procedure
to your clients using an IPC mechanism (named pipes, ...).
 
Back
Top