error function

Posted By: LazyDog

error function - 03/08/07 01:50

hello,

I'm using the error function to display information when in full-screen mode; however, I'm putting too much information out and the window is not big enough. Would you be willing to show your code for the error function so that I can recreate it and allow for a bigger size? I also want to learn how to put a dialog out when in full screen mode so this would be awesome to learn.

thanks,
Posted By: jcl

Re: error function - 03/08/07 08:19

The code is quite complicated because it does a lot of other things, but basically it's just a call to the MessageBox function of the Windows API. You could just call MessageBox with a char* pointer to your message.
Posted By: LazyDog

Re: error function - 03/09/07 13:16

I've tried both of these ways:
Code:
  
messagebox(0,PChar(S),'TEST',MB_OK or MB_TOPMOST or MB_SETFOREGROUND);

messagebox(ev.hWndMain,PChar(S),'TEST',MB_OK or MB_TOPMOST or MB_SETFOREGROUND);



neither show in front of the full screen game window. Are you using full screen exclusive mode? If so, do you switch this exclusive mode off before displaying the error function? Is there something I'm missing or is this just impossible to do from outside the engine?
Posted By: jcl

Re: error function - 03/09/07 14:14

You need to prepare the Messagebox by ending the scene (m_pd3dDevice->EndScene()) and calling the DirectX Dialogbox function. This is what we do:

Code:

...
if (!m_bWindowed)
m_pd3dDevice->SetDialogBoxMode(TRUE);
else
m_pd3dDevice->SetDialogBoxMode(FALSE);
}
int result = MessageBox(m_hWnd,
lpText,lpCaption,
uType|MB_TASKMODAL|MB_SETFOREGROUND|MB_TOPMOST);
...


© 2023 lite-C Forums