R
Regis Melo
Hello,
I'm trying to get the "EXE" name of app that runs the current
window. To get the current window I use:
[ DllImport("user32.dll") ]
private static extern
int GetForegroundWindow();
const int nChars = 256;
int handle = 0;
StringBuilder Buff = new StringBuilder(nChars);
handle = GetForegroundWindow();
GetWindowText(handle, Buff, nChars)
return Buff.toString(); // Returns the title of
// current window
If this funcion returns "MSN Hotmail", for example, I want to get
"iexplorer.exe", indicating that the current window is "ieplorer.exe".
Thanks,
Regis
I'm trying to get the "EXE" name of app that runs the current
window. To get the current window I use:
[ DllImport("user32.dll") ]
private static extern
int GetForegroundWindow();
const int nChars = 256;
int handle = 0;
StringBuilder Buff = new StringBuilder(nChars);
handle = GetForegroundWindow();
GetWindowText(handle, Buff, nChars)
return Buff.toString(); // Returns the title of
// current window
If this funcion returns "MSN Hotmail", for example, I want to get
"iexplorer.exe", indicating that the current window is "ieplorer.exe".
Thanks,
Regis