Active window

  • Thread starter Thread starter Sebastiano
  • Start date Start date
S

Sebastiano

I want my Windows Form application to catch the current active window, doing
some works, and then reactivate the previous window. How can I do this with
..NET Framework? Or I have to use API functions?

Many thanks

Sebastiano
 
Try the static property Form.ActiveForm to obtain it, and calling Activate()
on the form to make it active again.
 
But the active application/window isn't part of my program...it may be any
windows program! My application runs in background and, when a particular
event occur, it shows in foreground and becames the new active window. At
this time a want to save "a reference" to the old active window, so I can
reactive it when the user put another time in background my application.

I hope I have been more clear now

Sebastiano
 
I see. I think you'll then want to call the API method GetForegroundWindow.
 

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

Back
Top