Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Wachar

MessageBox() Icon

This topic is 6033 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you make an icon of your own appear on a MessageBox? Like, maybe through a resource file? ---------------------- Always will be smarter than you, --=ME=-- ----------------------

Share this post


Link to post
Share on other sites
Advertisement
You''ll need to use the MessageBoxIndirect function rather that MessageBox.
The MessageBoxIndirect prototype:

  
int MessageBoxIndirect (
LPMSGBOXPARAMS lpMsgBoxParams
)

/* With the MSGBOXPARAMS: */
typedef struct {
UINT cbSize,
HWND hwndOwner,
HINSTANCE hInstance,
LPCSTR lpszText,
LPCSTR lpszCaption,
DWORD dwStyle,
LPCSTR lpszIcon,
DWORD dwContextHelpId,
MBGBOXCALLBACK lpfnMsgBoxCallback,
DWORD dwLanguageId
} MSGBOXPARAMS, *PMSGBOXPARAMS, FAR* LPMSGBOXPARAMS;

/* For Instance: */


// Create the parameters

MSGBOXPARAMS p;
p.cbSize = sizeof(p);
p.hwndOwner = NULL;
p.hInstance = g_hInstance;
p.lpszText = "Fun with messageboxes";
p.lpszCaption = "Hepp";
p.dwStyle = MB_OK;
p.lpszIcon = MAKEINTRESOURCE(IDI_MYICON1);
p.dwContextHelpId = 0;
p.lpfnMsgBoxCallback = NULL;
p.dwLanguageId = MAKELANGID(LANG_NEUTRAL);

// Show the messagebox

MessageBoxIndirect (&p);



-Neophyte
MessageBoxIndirect (&p);

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GED d- s:+ a- C++$ UL++ P++ L++ E W+ N+ o K? w !O M--(+) V-- PS+
PE Y+ PGP t-- 5++ X+ R(+) rv+(++) b+++ DI+ D(+) G e+>++ h r--> y+
----- END GEEK CODE BLOCK-----
geekcode.com

Share this post


Link to post
Share on other sites
Can you give me an example in real a functioning program? (just the code in the .cpp).

----------------------
Always will be smarter
than you,
--=ME=--
----------------------

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!