Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set size of menu font?
Message
 
 
To
04/12/2000 09:18:40
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00448746
Message ID:
00449577
Views:
11
>Can anyone share with me the API calls that would set the menu font on a users machine? Thanks.
Hi Calvin,
I'll do my best not to lecture you on what you should and shouldn't play with, blah, blah, blah...

Also, I trust that: either you have sufficient experience to know the benefit of distinct Development, Testing and Production environments, OR if you screw things up completely (and in a Production situation) that you will look upon it as a learning opportunity!

Anyway, the font settings you need to change (in NT4) are stored in the registry under a weird looking key for the current user:
"HKEY_USERS\S-1-...a bloody big number...\Control Panel\Desktop\WindowMetrics"
double click on MenuFont. But a much simpler key for the default User:
"HKEY_USERS\.Default\Control Panel\Desktop\WindowMetrics"
(note the period in front of Default) although, for this key you will probably need to add the MenuFont value.

This does not look like a trivial value to be playing with - the font size 'appears' to be stored in the first byte. With an approximate value of (in hex) 0xFF - nPointSize. I say approximate because I've just spent the last 10 minutes messing with my Display Settings and observing the effect on the registry key. Viz. (for Tahoma):
Point Size     First Byte
----------      ----------
    8             0xF5
    9             0xF4
    10            0xF3
    11            0xF1  (note that 0xF2 is missing)
    12            0xF0
    13            0xEF
    14            0xED  (note that 0xEE is missing)
Hopefully, you get the picture. I have no idea how you would programmatically obtain the perverse big number in the key above - but where there is a will, there is usually a queue :-)

Check out the Fox Foundation Classes for code to access / manipulate and create registry keys (probably also some useful bits here on the UT in the Files Section.

Hopefully this was helpful, and not just an academic exercise.
censored.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform