Jump to content
Sign in to follow this  
Rocky

MessageBox in FSX

Recommended Posts

When a gauge needs to display an error message, the MessageBox works fine when FSX is in windowed mode, but when it is in full screen mode, the mesageBex appears behind, so it is invisible...Do you have any idea to make it work fine?Thanks,Eric

Share this post


Link to post
Share on other sites

I noticed that is also happens with FS2004. When it is in full screen mode and the gauge displays a messageBox, it appears BEHIND the FS window, so it is invisible...Any help is greatly welcome.Eric

Share this post


Link to post
Share on other sites

Hi EricWhat happens if you make the messagebox modal? In theory it should then stay on top because a modal box suspends everything else until it is acted on.-Dai

Share this post


Link to post
Share on other sites

A message box is naturally modal, you don't have anything to do to make it modal. You're absolutely right, as it is a modal window, it suspends everything until it is closed. So this leads to a strange situation: the message box pops up (behind the FS window, so it is invisible), and FS is suspended... If you don't know what is happening, you may think FS is blocked and you have to close it. In fact, if you just press Return, it acts as if you press the OK button of the message box, and FS comes back to life...I'm helpless :-(Eric

Share this post


Link to post
Share on other sites

You could build a gauge to display your messages. Set all the gauge elements to be hidden if the length of the displayed string is zero. The mouse click function for the gauge could be used to clear the string, thus returning all the gauge elements to a hidden state.Doug

Share this post


Link to post
Share on other sites

MB_SystemModal should do the trick. IIRC - and it's been a while since I used it - MB_SystemModal halts everything and makes the messagebox the TopMost window.-Dai

Share this post


Link to post
Share on other sites

You have to put FSX into "DialogMode" first, then display your dialog. The SimConnect SDK has a sample program that shows you how to do it.

Share this post


Link to post
Share on other sites

Hello Guys,OK for FSX, but what about FS2004?MB_SYSTEMMODAL still didn't do the trick. When FS2004 is in full screen mode, the MessageBox hangs all the other applications, but still appears behind FS2004. Sometimes it is in front (perfect), sometimes in the back (invisible)...I think I will develop a specific gauge for message displays...Thanks for your help !!Eric

Share this post


Link to post
Share on other sites

For FS2004 I just used the standard MessageBox function, passing in the window handle to FS98MAIN. Worked fine for me.

Share this post


Link to post
Share on other sites

I tried everything, by passing the FS window handle or by passing NULL as the window handle. In both cases, the result is the same: it sometimes work fine, and sometimes not. I really don't know on what it depends, but I can't be 100% sure the message box is displayed IN FRONT of the FS window (full screen).I keep searching...Thanks ;-)Eric

Share this post


Link to post
Share on other sites

>I tried everything, by passing the FS window handle or by>passing NULL as the window handle. In both cases, the result>is the same: it sometimes work fine, and sometimes not. I>really don't know on what it depends, but I can't be 100% sure>the message box is displayed IN FRONT of the FS window (full>screen).>I keep searching...>>Thanks ;-)>Eric>The problem is DirectX.To display a dialog box in full screen mode in DirectX, you need to flip from the back buffer to the primary buffer.There is an example of a Dialog in full screen mode in the DirectX SDK (part of the platform SDK). But if you want I could send you the DX full screen examples from the SDK.email me at 'alstoer1@compuserve.com' Myself I was unsuccessfull in getting a popup dialog to work in a FS2004 gauge, and eventually gave up. But I'd be interested in seeing this work out if someone has more determination than I did.RegardsErnie.


ea_avsim_sig.jpg

Share this post


Link to post
Share on other sites

Hello Ernie,Did you forget me?I conacted you by e-mail but never got any reply. You can send me the piece of code directly to my mail:marciano.eric@free.frThanks,Eric

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...