Changing parent window of process to launch 
Author Message
 Changing parent window of process to launch

Hello,

I would like to start off by saying I hope I'm posting this question
to the right newsgroup, if I'm not then please inform me where to
post....

Perhaps my understanding of things is a bit elementary, and I guess
trying to ask this question might reveal that. Anyway, say I wish to
launch an application, like Netscape or Internet Explorer, using a
function like, say, CreateProcess(). What I would like to do, though,
is run it hidden - if I were to launch Netscape or Internet Explorer,
I wouldn't want the user to see that I have ran it - it would run be
visible in the task-manager, but you wouldn't actually "see" the
application.

Now, my understanding of things tells me that in order for this to
happen, I would have to launch the process and make sure it's windows
were considered child windows of an already hidden parent window - so
that it would inherit the "invisible" properties of its parent.
Obviously running it such that all the windows of this application
consider themselves immediate children of the desktop window wouldn't
do because the desktop is visible.

So, is there a way for me to launch a window, and then launch a
application (and all its windows) "within an invisble window" so that
all windows of that process are invisible because they are inheriting
the invisible property of their parent? Basically it's like creating a
window, and then launching internet explorer or netscape in that
window....am I way off here? Am I missing a fundamental property of
windows (windows in general, not Microsoft windows).

This got me thinking after watching Virtual PC do its business, where
Windows was running "within a window". And yes, I understand it's all
emulated and such - but it still got me thinking.

Thanks for your time,
Ben



Sun, 27 Mar 2005 23:41:15 GMT  
 Changing parent window of process to launch
You can specify SW_HIDE in wShowWindow parameter of STARTUPINFO
structure you pass to CreateProcess. If you are lucky the application
honors this parameter - it is not really required to.

With Internet Explorer in particular, starting it as a COM server (see
CoCreateInstance) makes it create a hidden window, which you can then
show with IWebBrowser2::put_Visible.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hello,

> I would like to start off by saying I hope I'm posting this question
> to the right newsgroup, if I'm not then please inform me where to
> post....

> Perhaps my understanding of things is a bit elementary, and I guess
> trying to ask this question might reveal that. Anyway, say I wish to
> launch an application, like Netscape or Internet Explorer, using a
> function like, say, CreateProcess(). What I would like to do, though,
> is run it hidden - if I were to launch Netscape or Internet Explorer,
> I wouldn't want the user to see that I have ran it - it would run be
> visible in the task-manager, but you wouldn't actually "see" the
> application.

> Now, my understanding of things tells me that in order for this to
> happen, I would have to launch the process and make sure it's windows
> were considered child windows of an already hidden parent window - so
> that it would inherit the "invisible" properties of its parent.
> Obviously running it such that all the windows of this application
> consider themselves immediate children of the desktop window wouldn't
> do because the desktop is visible.

> So, is there a way for me to launch a window, and then launch a
> application (and all its windows) "within an invisble window" so that
> all windows of that process are invisible because they are inheriting
> the invisible property of their parent? Basically it's like creating a
> window, and then launching internet explorer or netscape in that
> window....am I way off here? Am I missing a fundamental property of
> windows (windows in general, not Microsoft windows).

> This got me thinking after watching Virtual PC do its business, where
> Windows was running "within a window". And yes, I understand it's all
> emulated and such - but it still got me thinking.

> Thanks for your time,
> Ben



Mon, 28 Mar 2005 00:57:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. changing parent window for child window

2. How can i get the Parent ID of a process on windows NT4

3. Processing a message the parent before the child window

4. How to debug a process launched by current process

5. Created Process dies when parent process closed

6. Creating the child process and redirected to parent process

7. Child Process & Parent Process Data :: Win32

8. changing window parents

9. Changing the parent of the programs main window

10. Changing Style of window in another process

11. How to relaod a parent window when a butto is clicked on a child window

12. keyboard message notification from a child window to the parent window

 

 
Powered by phpBB® Forum Software