Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hey, is it possible to make a MessageBox which is initiated in a secondary function appear in front of the current window and not behind?
Thanksdjas

Sure is!
Here is the Win32 prototype (so if you're using managed code you can import it from the win32 library. If you're attempting to to use MFC just use the same function, however drop the parameter for the handler (hWnd) and Win32 obviously there is no difference)
int MessageBox(
HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType
);for a list of the uTypes you can use go to:
http://msdn.microsoft.com/library/d...so an example of a topmost MessageBox (win32),
MessageBox(NULL,"Win32 Message","Message",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST);for help importing a Win32 message in C#, use the following article

![]() |
Progress bar in batch fil...
|
opening an image in pytho...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |