How to show dialog box on top of ALL windows?

M

Matthias

Hello all

How to force a dialog box to appear on top of ALL
desktop windows?

Detailed description of the situation:

- MS Win XP Pro
- Dotnet 2.0.50727
- Visual Studio 2005 Pro
- Application written in C# (visual Windows app)
- Application written in Paradox

The C# app can be controlled either via it's normal
menu, or it can be controlled via commandline parameters
(repeatedly, since it is an SDI application). So it
serves as a "batch service" for the Paradox application
(or any other program, calling it with an appropriate
commandline).

The user is working in Paradox, and under that,
the C# application does it's silent service, eventually
not visible, because covered.

This works nice ...

... except if a dialog box happens to pop up in C#.
Then the dialog is above the C# application, BUT UNDER
the calling Paradox application. Thus it's not visible
and will not be clicked away by the user.

The dialog is raised by such line:
throw new Exception ("... some text ...");

Question: How to force such dialog to appeare on
top of ALL windows? And if that's not possible with an
Exception dialog box, can it be done with the ordinary
MessageBox.Show()?

Thanks in advance

Norbert
 
M

Mattias Sjögren

If the application is supposed to work as a "silent service", wouldn't
it be better to return the error message to the client application and
let it handle it in whatever way it finds appropriate?


Mattias
 
N

Norbert C. Maier

Hi Mattias

Thank you for reply.
If the application is supposed to work as a "silent service", wouldn't
it be better to return the error message to the client application and
let it handle it in whatever way it finds appropriate?

Sure! But let me continue to discuss the situation.

This are two already existing and working applications.
I just expanded them with the ability to communicate
via commandline (and file). Very simple!

(1) Paradox houses an ordermanagement system "V4" with
bookkeeping and many other things.

(2) C-Sharp houses a banking module "Banking Commander"
for e.g. retrieving account statements and making bank transfers.

(2.1) The Banking Commander can be run interactively on
it's own. This nice. And necessary: e.g. the bank settings are
a bit more complicated and can only be done interactively.

(2.2) Additionally it can serve as a "batch service", listening
to external commands, executing them and returning lengthy
answers via file. This is also nice.

Your suggestion is correct! IF it's running in batch mode,
then it should as well return all messages on the batch
way, not interactively.

Only this means some quite expensive programming work!
Replace all dialogs with an alternative mechanism, depending
on the calling mode of the function. MUCH work for very rarely
occurring messages. With no functional advantage.

My favorite solution - and one I expect to be achievable
by a powerful programming system - were just to force the
dialog boxes to appear on top of ALL windows.

Thanks again

Norbert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top