Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change font menu of VFP
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00741708
Message ID:
00742228
Views:
37
>The mskb #Q130657 show methode change font of menu items, but font of menu pad cannot change.

Well, it's a bit of a sledgehammer approach, but you should be able to refine this down to what you actually want. Check out MSKB#Q181944 -- it shows how to retrieve system font information. The same function can _set_ system font information. When I ran it on my machine, it told me that the fonts for the non-client areas of the windows (for example, the menu pads) were set to Tahoma.

I modified the code in the article to look like this.
   NCM = SPACE(340)   && length of NonClientMetrics structure
   NCMData = Long2Str(LEN(NCM)) + REPLICATE(CHR(0),336)
   RetCode = SystemParametersInfo(41,340,@NCMData,0)
   IF RetCode = 0
      =MESSAGEBOX( "SystemParametersInfo call failed.  Last error was: " ;
      + STR(GetLastError()))
   ELSE
      NCMData = STRTRAN(NCMData, "Tahoma", "Modern") 
      *!* 41 was GetNonClientMetrics: 42 is SetNonClientMetrics
      RetCode = SystemParametersInfo(42,340,@NCMData,0)
*!* Everything down to the ENDIF is commented out.
*!*	      cbSize = str2long(SUBSTR(NCMData, 1, 4))
*!*	      iBorderWidth = str2long(SUBSTR(NCMData, 5, 4))
*!*	      iScrollWidth = str2long(SUBSTR(NCMData, 9, 4))
*!*	      iScrollHeight = str2long(SUBSTR(NCMData, 13, 4))
*!*	      iCaptionWidth = str2long(SUBSTR(NCMData, 17, 4))
*!*	      iCaptionHeight = str2long(SUBSTR(NCMData, 21, 4))
If you check in the Platform SDK on MSDN for SystemParametersInfo, you should be able to find the information you need to only change what you want to. Note that the Font name is a 32-character string with a null marking the end of the information - for example, "Lucida Console" + CHR(0).

Let us know if you have trouble.
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform