Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make MessageBox Always On Top ?

Status
Not open for further replies.

Burtlancaster

Programmer
Jul 22, 2004
12
0
0
GB
Created a very simple message box as follows.

Code:
if (Application->MessageBox("test", "tes",MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2) == IDYES)
{
}
code works fine but i need for the message box to be " Always On Top ", now I know i could just create my own form to act as a message box but it would make things a lot easier if there was a way of making the message box always on top. Any help would be much appreciated.
 
Ok i've found the answer to my problem, and its so simple its embarassing, but for any other numpties like myself here is the solution.
Code:
if (Application->MessageBox("test", "tes",MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2) == IDYES|MB_TOPMOST)
{
}
As you can see above all I have had to add is
Code:
|MB_TOPMOST
 
Nice, i didn't even knew that such a M_ existed! Now i've learned something!

Totte
Keep making it perfect and it will end up broken.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top