Computing.Net > Forums > Programming > C++ MessageBox() in front

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C++ MessageBox() in front

Reply to Message Icon

Name: djas
Date: December 2, 2006 at 00:38:05 Pacific
OS: Windows XP Home SP2
CPU/Ram: PM 1.73 GHZ 1GB RAM
Product: Gateway MX6635b
Comment:

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?
Thanks

djas



Sponsored Link
Ads by Google

Response Number 1
Name: StevenpWalsh
Date: December 13, 2006 at 13:06:03 Pacific
Reply:

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

http://msdn.microsoft.com/msdnmag/i...


0

Response Number 2
Name: djas
Date: December 22, 2006 at 06:20:20 Pacific
Reply:

Thanks for getting back to me,
by importing from the Win32 library do you mean linking?
Thanks

djas


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Progress bar in batch fil... opening an image in pytho...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C++ MessageBox() in front

MessageBox in the Thread www.computing.net/answers/programming/messagebox-in-the-thread/579.html

how to compile C program in edit pl www.computing.net/answers/programming/how-to-compile-c-program-in-edit-pl/8975.html

To Run C,C++ Language in XP-64 bit www.computing.net/answers/programming/to-run-cc-language-in-xp64-bit-/17883.html