If I run the following code from VS2003 to a PPC 2003 emulator:

static void Main()
{
MessageBox.Show("hi");
Application.Run(new MainForm());
}

The first time it runs I only see the message box. Subsequent runs of
the app on the emulator show the form.

It seems like this is what is happening:
- I click the 'X' on the message box, but the app is still running.
- The form opens but I don't see it.
- When I launch the app subsequent times, the form that already exists
is merely becoming visible.
- When I close the app it doesn't really close.

Is that what's going on here? If so, where is my form after I 'X' the
message box?

Re: What's going on here? by Daniel

Daniel
Tue Nov 30 15:25:51 CST 2004

After you close the msgbox, you need to bring your app to the foreground.
One way to do this is to pinvoke SetForegroundWindow from the form's Load
event.

If you want your app to really close (rather than minimise), set the form's
MinimizeBox to false.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Brad" <bradley_.wood_@ndsu_.nodak_.edu> wrote in message
news:ek6p66x1EHA.3000@TK2MSFTNGP15.phx.gbl...
> If I run the following code from VS2003 to a PPC 2003 emulator:
>
> static void Main()
> {
> MessageBox.Show("hi");
> Application.Run(new MainForm());
> }
>
> The first time it runs I only see the message box. Subsequent runs of the
> app on the emulator show the form.
>
> It seems like this is what is happening:
> - I click the 'X' on the message box, but the app is still running.
> - The form opens but I don't see it.
> - When I launch the app subsequent times, the form that already exists is
> merely becoming visible.
> - When I close the app it doesn't really close.
>
> Is that what's going on here? If so, where is my form after I 'X' the
> message box?