LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Message popup title bar icon

Is is possible to change the title bar icon on popup messages. I want for example a special icon for error messages, another for info messages and so on. It shouldn't be the same as the application title bar icon.
0 Kudos
Message 1 of 3
(3,744 Views)
Hi,

Unfortunately, you can't change this using any of CVI's base commands. This is usually statically set when you build the application and specify an icon file in your target settings. You would have to go into using Windows SDK commands to possibly do this programmatically. As a suggestion, what if you just create your own dialog box from a CVI panel and put a picture on the dialog? Then, in your code instead of calling MessagePopup, call InstallPopup and call your panel. Use GetUserEvent to wait for the user to dismiss the dialog so you don't have to create a callback for the dialog box, and also it will hold the execution so that the user must dismiss the box. That may be easier for you to implement than going through SDK calls.

Jeremy L.
Nationa
l Instruments
Jeremy L.
National Instruments
0 Kudos
Message 2 of 3
(3,744 Views)
It's easy to use the Windows SDK MessageBox function to display different icons on the dialog box (not on the title bar).
Add ...\CVI\sdk\lib\user32.lib to your project.
#include in your C file.
Call MessageBox like this.
MessageBox(NULL,"Here's a message with an icon.",
"Message with icon", MB_SYSTEMMODAL | MB_ICONINFORMATION);
Other icon values include MB_ICONWARNING, MB_ICONQUESTION, MB_ICONERROR.
Click here for additional info on MessageBox.
Message 3 of 3
(3,744 Views)