From: Simon on
Hi,

I am launching an application from my own application using
CreateProcess(...).

As I do not want my application to 'hang' while the other is running I
start a thread that has a nice dialog always on top to indicate to the
user that the other app is running.

But if the user click on my application it automatically brings it to
the front.
Because of my dialog box this is not really a problem, the user cannot
really do anything, but ideally I would like to keep the other
application on top as it has its own 'progress'.

I don't necessarily want it to be the top most window, I would just like
to keep it on top of my Window.

How would you achieve that?

Simon
From: David Ching on
"Simon" <bad(a)example.com> wrote in message
news:eyh3ZnW3KHA.4332(a)TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I am launching an application from my own application using
> CreateProcess(...).
>
> As I do not want my application to 'hang' while the other is running I
> start a thread that has a nice dialog always on top to indicate to the
> user that the other app is running.
>
> But if the user click on my application it automatically brings it to the
> front.
> Because of my dialog box this is not really a problem, the user cannot
> really do anything, but ideally I would like to keep the other application
> on top as it has its own 'progress'.
>
> I don't necessarily want it to be the top most window, I would just like
> to keep it on top of my Window.
>
> How would you achieve that?
>

When your window was activated (WM_MOUSEACTIVATE and WM_ACTIVATE), you can
call SetWindowPos without SWP_NOZORDER and set your window underneath those
of the other apps. This is a real pain, it requires you to iterate using
FindWindow and find the other app's window.

Maybe you can tweak your design a little. Add a Minimize button to your
dialog to make it easy to get your app out of the way or something.

-- David


From: Hector Santos on
If I follow you design, wouldn't making the 2nd dialog a Style = Child
do the trick?

Simon wrote:

> Hi,
>
> I am launching an application from my own application using
> CreateProcess(...).
>
> As I do not want my application to 'hang' while the other is running I
> start a thread that has a nice dialog always on top to indicate to the
> user that the other app is running.
>
> But if the user click on my application it automatically brings it to
> the front.
> Because of my dialog box this is not really a problem, the user cannot
> really do anything, but ideally I would like to keep the other
> application on top as it has its own 'progress'.
>
> I don't necessarily want it to be the top most window, I would just like
> to keep it on top of my Window.
>
> How would you achieve that?
>
> Simon



--
HLS
From: David Ching on
"Hector Santos" <sant9442(a)nospam.gmail.com> wrote in message
news:#Ijr0zY3KHA.5588(a)TK2MSFTNGP06.phx.gbl...
> If I follow you design, wouldn't making the 2nd dialog a Style = Child do
> the trick?
>

The second dialog already sounds like it is a child (it stays in front of
his original window), but that doesn't prevent it from covering the windows
of the launched app.

-- David

From: Hector Santos on
David Ching wrote:

> "Hector Santos" <sant9442(a)nospam.gmail.com> wrote in message
> news:#Ijr0zY3KHA.5588(a)TK2MSFTNGP06.phx.gbl...
>> If I follow you design, wouldn't making the 2nd dialog a Style = Child
>> do the trick?
>>
>
> The second dialog already sounds like it is a child (it stays in front
> of his original window), but that doesn't prevent it from covering the
> windows of the launched app.


Right.

He indicated he wasn't too concern about access to the main window
("he user cannot really do anything"), so why not just this process
'watch/progress" dialog modal with a auto close when finish?

Or is he talking about the child process window staying on top within
the parent window?

I guess, if its console, he can Allocate/Attach a Console which under
XP/2003+ I believe you can tie it within a region the parent window.
That use to be an old desire.

If its a GUI, that would be interesting.

--
HLS
 |  Next  |  Last
Pages: 1 2 3
Prev: PreTranslateMessage
Next: managed code and dll