ok great Mattias
So the first thing my app has todo then is call GetForegroundWindow
and then GetWindowThreadProcessId I'lll know the process name.
Then I can load a window that I want to be open for a few seconds
then removed.
Then the process before will be active again, is this correct??
"Mattias Sjögren" <ma********************@mvps.orgwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I am writing app that I want to be able to hit a shortcut
key (windows wide) and have it all launch my app and then
be able to get the name of the process that was active when
the key was pressed.
Is this possible and how?
The GetForegroundWindow Win32 API function will tell you which window
is in the foreground. GetWindowThreadProcessId will tell you which
process that indow belongs to.
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.