How to get handle to an application?
-
Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.
priyank
-
Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.
priyank
-
Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.
priyank
Instead of using
ShellExecute
, useCreateProcess
. You can then eaisly get a handle to the app you executed."Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.
priyank
SHELLEXECUTEINFO structure contains a member variable hProcess contains a handle to the new started process, but you mast set fmask to SEE_MASK_NOCLOSEPROCESS. and it will be NULL if no process launched. Hope this help you.
Programmer/ Eid Mahmoud Taha
-
Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.
priyank
pri_skit wrote:
Actually i am using ShellExecuteEx function...
Can you use
ShellExecuteEx()
instead?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Instead of using
ShellExecute
, useCreateProcess
. You can then eaisly get a handle to the app you executed."Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
SHELLEXECUTEINFO structure contains a member variable hProcess contains a handle to the new started process, but you mast set fmask to SEE_MASK_NOCLOSEPROCESS. and it will be NULL if no process launched. Hope this help you.
Programmer/ Eid Mahmoud Taha
-
You can use EnumWindow function (see MSDN). This way you'll get handles of all toplevel windows from your system. Now if you know some properties of the window you want to maximize(ex. windows name), you can easy find and maximize it.