current focus application

  • Thread starter Thread starter bic
  • Start date Start date
B

bic

I have a background application that run in the background. When any
pocketOutlook record is changed/modified/deleted this application has
a trigger that run some codes. What I need to know how do I determine
what is the "current focused application" (ie.. Calendar, Task,
Contact) that running?
 
I would suggest to use P/Invoke to call:
1) GetFocus() to get the handle of the window that has focus
2) GetWindowThreadProcessId() to get the process ID of the owning process
3) Toolhelp and Process32First/Process32Next Module32First/Module32Next to
get the module (.exe) name
 
Back
Top