Trap window activation and get title

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
 
H

Herfried K. Wagner [MVP]

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, ...).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top