-
April 22nd, 2013, 05:46 AM
#16
Re: running a GUI program in the background
so where should i call ShowWindow again in my test program?
and do you mean like this:
Code:
ShowWindow(hWnd, SW_SHOW );
-
April 22nd, 2013, 05:50 AM
#17
Re: running a GUI program in the background
Where you want to.
But you must be sure (you have to test it!) that this second call is really executed.
Victor Nijegorodov
-
April 22nd, 2013, 05:59 AM
#18
Re: running a GUI program in the background
ok adding the line ShowWindow(hWnd, SW_SHOW ); to the test program causes the window to be displayed when i run createprocess
-
April 22nd, 2013, 06:03 AM
#19
Re: running a GUI program in the background
Good! So now you know a possible reason for the external program to be displayd despite of your startup parameter set to SW_HIDE!
Victor Nijegorodov
-
April 22nd, 2013, 06:12 AM
#20
Re: running a GUI program in the background
ok so how do i solve this problem? what code do i need to hide the window?
-
April 22nd, 2013, 06:20 AM
#21
Re: running a GUI program in the background
Well, the best way would be to change this external program so it will never call ShowWindow with any but SW_SHOWDEFAULT parameter.
It you cannot change this program then you could try with (WH_CBT) HOOK...
Victor Nijegorodov
-
April 22nd, 2013, 06:24 AM
#22
Re: running a GUI program in the background
i can't change the external program so could you show some code for (WH_CBT) HOOK?
-
April 22nd, 2013, 06:27 AM
#23
Re: running a GUI program in the background
No, I cannot. But you could make a Google search for something like global hook WH_CBT example
Victor Nijegorodov
-
April 22nd, 2013, 06:33 AM
#24
Re: running a GUI program in the background
ok hook be used in a c++ console application? examples on google only seem to be showing examples in win32
-
April 22nd, 2013, 06:39 AM
#25
Re: running a GUI program in the background
What "c++ console application" are you talking about? What is a problem with a "console application"?
Victor Nijegorodov
-
April 22nd, 2013, 06:42 AM
#26
Re: running a GUI program in the background
my createprocess program is a console application (the code i put in the first post). can i add hook WH_CBT to this?
-
April 22nd, 2013, 06:44 AM
#27
Re: running a GUI program in the background
No, you need to create a HOOL dll to hook an external applications!
Victor Nijegorodov
-
April 22nd, 2013, 06:50 AM
#28
Re: running a GUI program in the background
i have never used HOOK before. is there an easier way to hide the window of the external program?
-
April 22nd, 2013, 07:00 AM
#29
Re: running a GUI program in the background
Well, the one and only one way to hide the window is to call ShowWindow with SW_HIDE for this window (or its parent)
So if you know the handle of the main window of this external program then you could try to hide it.
But the question is how often you will have to repeat it! What if this external program tries to maximize or restore its main window every second?
Victor Nijegorodov
-
April 22nd, 2013, 07:28 AM
#30
Re: running a GUI program in the background
i don't know anything about the code of the external program.. so i guess SW_HIDE isn't a good option then
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|