How to find if a process has active UI ?
-
-
Hi all Our application has to kill OUTLOOK.exe if it runs only in background . Assuming we already have process id and handle to kill it with TerminateProcess , how to find if this outlook.exe has UI active or not ?? Any APIs please ...
redindian
Use
EnumWindows
to enumerate all open windows. UseGetWindowThreadProcessID
on the window handle to get the process Id of the window. Compare with the process Id you already have. Now you can useTerminateProcess
(or a better way) to kill outlook.«_Superman_»
-
Use
EnumWindows
to enumerate all open windows. UseGetWindowThreadProcessID
on the window handle to get the process Id of the window. Compare with the process Id you already have. Now you can useTerminateProcess
(or a better way) to kill outlook.«_Superman_»
-
I am already aware of how to enumerate the processes and kill it . What I want to know is : To find if a process is running in background or running with UI ....
redindian
EnumWindows
«_Superman_»
-
Hi all Our application has to kill OUTLOOK.exe if it runs only in background . Assuming we already have process id and handle to kill it with TerminateProcess , how to find if this outlook.exe has UI active or not ?? Any APIs please ...
redindian
dharani wrote:
runs only in background
Define what you mean by that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
I am already aware of how to enumerate the processes and kill it . What I want to know is : To find if a process is running in background or running with UI ....
redindian
dharani wrote:
What I want to know is : To find if a process is running in background or running with UI ....
You may want to check out functions like
IsWindowVisible()
,IsWindowIconic()
,SendMessageTimeout(hWnd, WM_NULL, ...)
, andGetForegroundWindow()
."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons