Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » AfxMessageBox and MessageBox question Collapse All
Subject Author Date
tera tera Oct 28, 2008 - 6:41 PM

Hello.


 I want to display AfxMessageBox( or MessageBox ) in the central location of the grid.

Is such a thing impossible?


Peter Meier Nov 8, 2008 - 5:41 AM

Hi


Thank you for the skinned messagebox example. However, using it "as is" in a customizable application does assert when resetting control bars within the customization dialog, due to the application resources not being found when the AfxMessageBox function is called from within Prof-UIS.


I had to add AfxSetResourceHandle(m_hRes) to the DoMessageBox function, whereby m_hRes is loaded with m_hRes = AfxGetResourceHandle() in InitInstance of the my application.


With that, it seems to works fine.


 

Technical Support Nov 10, 2008 - 1:25 PM

Thank you for your comments. This message box is not our work. It’s just ported to Prof-UIS and it’s possible to improve it and make it having no resources. For instance, Prof-UIS’s About box does not use dialog resources.

Technical Support Oct 29, 2008 - 2:11 PM

The following thread contains a code snippet which describes how to subclass a standard message box:

http://www.prof-uis.com/prof-uis/tech-support/support-forum/vista-61961.aspx

But you should use the CDialog-based class instead of CExtResizableDialog-based.

If you also need a skinned message box, you can use the code from the following test project:

http://www.prof-uis.com/download/forums/MsgBoxTest.zip

The skinned message box test project above is a Prof-UIS based version of a custom message box discussed in the following article:

http://www.codeproject.com/KB/dialog/xmessagebox.aspx