Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getforewindow detection?

Status
Not open for further replies.

cellpeter

Programmer
Dec 30, 2004
34
US
ok i am wondering if it is possible to detect if the window in the foreground has changed.. for example

if current foreground window is say mozilla and then user decides to use winamp ,so winamp becomes the current foreground window

i was wondering if it is possible for a program to detect the change and maybe give of a message?

is there an id for each window created?

thanks for any replies
 
I think this could be done with a systemwide message hook looking for WM_SETFOCUS. If you can detect those messages you will know when the foreground window has changed.There may be other ways of doing this.Check out the documentation on hooks and hooking on MSDN.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top