Please Add title bar parameter to error()

Posted By: pararealist

Please Add title bar parameter to error() - 08/07/09 00:58

Hi,

Would it be possible to add the title bar string to the
error() function?
OR
could you overload the error function

Code:
error("title str","message");



if title str is "" then it displays the default error code
in title bar, else it displays title str.

This is because i like to display in which function
the error takes place in the title bar.
Posted By: jcl

Re: Please Add title bar parameter to error() - 08/07/09 08:56

The error() function is sort of superfluous in lite-C. You can just use the Windows MessageBox function, with any title and buttons that you desire.
Posted By: TechMuc

Re: Please Add title bar parameter to error() - 08/07/09 09:04

simply:

Code:
#define errorT(Message,Title) MessageBox(hWnd,Message,Title,MB_OK|MB_ICONSTOP)

errorT("my Message","my Title");


Posted By: EvilSOB

Re: Please Add title bar parameter to error() - 08/07/09 09:47

But Ive found that doesnt work terribly reliably if you are in full-screen mode.
(unfortunately, this mis-behaviour is not consistant)
Posted By: jcl

Re: Please Add title bar parameter to error() - 08/07/09 10:17

For a MessageBox in fullscreen mode, you need to call the DirectX function SetDialogBoxMode(TRUE) before.

if (fullscreen)
d3dDev->SetDialogBoxMode(TRUE);
else
d3dDev->SetDialogBoxMode(FALSE);

MessageBox(hWnd,Text,Title,MB_OK|MB_ICONSTOP|MB_TASKMODAL|MB_SETFOREGROUND|MB_TOPMOST);


Posted By: FBL

Re: Please Add title bar parameter to error() - 08/08/09 18:06

This calls for a library function smile
Posted By: EvilSOB

Re: Please Add title bar parameter to error() - 08/09/09 09:28

Hmmm, I'll have to look into this. Thanks again JCL.
© 2024 lite-C Forums