Finding last Application that had focus

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

I'm writing a program that forces users to click on a button to run a
validation process. After they are done I want the application to
lose focus and revert to the last program that was in use. Anyone
code anything like this ever before?

-Peter
 
* (e-mail address removed) (Peter) scripsit:
I'm writing a program that forces users to click on a button to run a
validation process. After they are done I want the application to
lose focus and revert to the last program that was in use. Anyone
code anything like this ever before?

You will have to listen for 'WM_ACTIVATEAPP'/'WM_ACTIVATE' in the
'WndProc' of the form and reset the focus to this application (p/invoke
on 'SetForegroundWindow' or something similar.
 
Back
Top