Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The system menu is a system menu. Fonts of system components (eg also form titlebars) are determined by Windows.VFP Help said:The FONT clause is ignored for menu titles added to the Visual FoxPro system menu _MSYSMENU
DEFINE BAR _mfi_open OF _mfile PROMPT "\<Open..." ;
[b]FONT 'Verdana', 14 ;[/b]
KEY CTRL+O, "Ctrl+O" ;
PICTRES _mfi_open ;
MESSAGE "Opens an existing file"
If you use the menu designer, keep at default and eg start with the "Quick Menu", you get menu and items, which when later running the genmenu generated mpr will establish/replace the system menu in the _screen.
oForm = CreateObject("toplevelform")
DO menu1.mpr WITH oForm
oForm.Show()
Define Class toplevelform as form
ShowWindow = 2
Enddefine
Declare integer SystemParametersInfo in win32api integer uiAction, integer uiParam, string@ pvParam, integer fWinIni
#define SPI_GETNONCLIENTMETRICS 41
#define SPI_SETNONCLIENTMETRICS 42
#define SPIF_SENDCHANGE 2
#define NCM_SIZE 10*4+5*60
#define FW_ULTRALIGHT 200
#define FW_REGULAR 400
#define FW_BOLD 700
#define FW_HEAVY 900
* Get current settings
ncm_current = Padr(BinToC(NCM_SIZE,"4RS"),NCM_SIZE,Chr(0))
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,NCM_SIZE, @ncm_current, 0)
ncm_changed = m.ncm_current
* get the logfont structure
lcFontStr = SUBSTR(m.ncm_current,161,60)
lcFontStrChanged = lcFontStr
* get the current values
nheight = CTOBIN(LEFT(m.lcFontStr,4),"4RS")
nweight = CTOBIN(SUBSTR(m.lcFontStr,17,4),"4RS")
nitalic = CTOBIN(SUBSTR(m.lcFontStr,21,1),"1RS")
nunderline = CTOBIN(SUBSTR(m.lcFontStr,22,1),"1RS")
nstrike = CTOBIN(SUBSTR(m.lcFontStr,23,1),"1RS")
cfontname = SUBSTR(lcFontStr,29)
* Fontname = Arial
lcFont = "Arial"
lcFontStrChanged = STUFF(m.lcFontStrChanged,29,32,m.lcFont + REPLICATE(CHR(0), 32 - LEN(m.lcFont)))
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStrChanged)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
MESSAGEBOX("Arial")
* Fontsize = 14
lnFontSize = 14
lcFontStrChanged = STUFF(m.lcFontStrChanged,1,4,BINTOC(getheight(m.lnFontSize),"4RS"))
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStrChanged)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
MESSAGEBOX("Fontsize = 14")
* Bold
lcFontStrChanged = STUFF(m.lcFontStrChanged,17,4,BINTOC(FW_BOLD ,"4RS"))
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStrChanged)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
MESSAGEBOX("Bold")
* Italic
lcFontStrChanged = STUFF(m.lcFontStrChanged,21,1,BINTOC(1 ,"1RS"))
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStrChanged)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
MESSAGEBOX("Italic")
* Underline
lcFontStrChanged = STUFF(m.lcFontStrChanged,22,1,BINTOC(1 ,"1RS"))
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStrChanged)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
MESSAGEBOX("Underline")
* Strikethrough
lcFontStrChanged = STUFF(m.lcFontStrChanged,23,1,BINTOC(1 ,"1RS"))
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStrChanged)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
MESSAGEBOX("Strikethrough")
* change back
ncm_changed = STUFF(m.ncm_changed,161,60,m.lcFontStr)
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)
FUNCTION getheight
LPARAMETERS tnPointSize
DECLARE INTEGER GetDC IN USER32 INTEGER hwnd
DECLARE INTEGER ReleaseDC IN USER32 INTEGER hwnd, INTEGER hdc
DECLARE INTEGER GetDeviceCaps IN GDI32 INTEGER hdc, INTEGER nIndex
DECLARE integer MulDiv IN Kernel32 INTEGER, INTEGER, INTEGER
LOCAL lnhDC, lnfHeight, LOGPIXELSY
LOGPIXELSY = 90
lnhDC = GetDC(0)
lnfHeight = -MulDiv(tnPointSize, GetDeviceCaps(lnhDC, LOGPIXELSY), 72)
lnhDC = ReleaseDC(0, lnhDC)
CLEAR DLLS "GetCD", "ReleaseDC", "GetDeviceCaps", "MulDiv"
RETURN lnfHeight