Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I need to write an app wherein I need to know everytime the active window changes on a Windows machine. I don't want to use a continuous loop for this. I need some event I can subscribe to do the job.

For more clarity: When I say active window changes I mean when user switches windows e.q. going from IE to Windows explorer to Notepad to Outlook etc.

Rashmi
Posted
Updated 23-Jan-12 18:23pm
v2
Comments
Sergey Alexandrovich Kryukov 23-Jan-12 22:53pm    
The solution is very easy, but the question is not fully formulates. Please tag your application type, UI library. What is it: WPF, Forms, Silvelight, anything else?

--SA
Member 8253943 24-Jan-12 0:14am    
I have rephrased my query. Could you share that 'very easy solution' please?
Sergey Alexandrovich Kryukov 25-Jan-12 1:52am    
No, because you are not answering my question!
Sorry, I had enough of it.
--SA
Sergey Alexandrovich Kryukov 23-Jan-12 22:54pm    

A suggestion to all experts:

We should stop attempting to answer any questions if OP does not properly specify type of application, UI library and other relevant detail which would exclude this kind of confusion. All type mentioned in the question should be written in fully-qualified form. We should request it and only answer when OP comply. Multiple failures to specify such detail became a curse of this forum.



--SA
Dave Kreskowiak 23-Jan-12 23:00pm    
Are you kidding?? We wouldn't be answering any questions at all then.

AFAIK, the only way to do that would be to write up a CBTProc hook. Documentation on it can be found here[^]. You'll also need to read up on these[^].
 
Share this answer
 
Comments
Member 8253943 24-Jan-12 5:17am    
Hi Dave, the second link in your post opens up google.com. Can you update it please?
Dave Kreskowiak 24-Jan-12 7:52am    
It's supposed to open up to Google. This is where you do research into the CBT Hook.
What's meaning of changes you said?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900