LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How Do you Configure Font for CVI message/prompt Pop-Ups programaticlly from a CVI C module? Plenty of info to get attributes but how do I set them?

How Do you Configure the Font for CVI message/prompt Pop-Ups programaticlly from a CVI C module? Plenty of info on how to get attributes but how do i set them?
Note This is using the standard LabWindows CVI message/Prompt Pop Ups.
0 Kudos
Message 1 of 3
(3,554 Views)
The standard CVI popups use one of the built-in fonts, "NIMessageBoxMetaFont" (defined as VAL_MESSAGE_BOX_META_FONT in userint.h). There is no attribute to change this.

However, there is a way to override the underlying font that "NIMessageBoxMetaFont" resolves to. By default, it resolves to a system font that was ultimately set by the end user in the Display Properties, or somesuch. But you can override that association through the system registry, and you can do it in a way that only affects CVI programs. There are three registry values you can set:

MessageBoxFontName
MessageBoxFontSize
MessageBoxFontBold

The path of the registry key where you want to create these values is the following:

HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\CVI Run-Time En
gine\cvirte

You don't need to create all three. CVI will use whichever ones you put in there and use the defaults for the remainder. You must create them as string values.

Now, the thing to remember is that if you just open up the registry editor and create these values there, all CVI programs will use this font. If you want to turn it on and off programmatically you'll have to switch these keys in and out dynamically. This means you'll have to write a program to create the registry values yourself. (The Programmer's Toolbox library has a set of functions for this which should make it relatively easy).

If you do decide to modify the registry programmatically, you need to keep in mind that it won't affect the program in which you modify it. So you'd have to have two CVI programs that run sequentially (assuming you then remove the registry changes in your second program).

I know it's a bit complicated, but it's a possibility, in case you really need to do this.

Luis
NI
0 Kudos
Message 2 of 3
(3,554 Views)

John,

I understand there is no

immediate way of doing this as you describe. I have found a way to do this and you can try it and help others. What you have to do is the following:

1. Create the registry keys you need.

2. use regedit to export the keys to a file "Fontsize.reg".

3. Create a batch file that would use "regedit /s Fontsize.reg"

3. In the code you can call "

int LaunchExecutableEx (char *fileName, int windowState, int *handle);" to handle all commands if you wish and also use "int ExecutableHasTerminated (int executableHandle);" to handle the return values. You can also check with "int RetireExecutableHandle (int executableHandle);" to complete the program.

Hope this is helpful for future requests.

Thank you,

0 Kudos
Message 3 of 3
(3,292 Views)