Changing Command Window Font Programmatically

The code uses Editor functions from Foxtools.fll. See George Tasker's Extended Foxtools Help Download #9333 on UT for more info.

This is sample code. Add error handling and adjust to your requirements as necessary.

LOCAL ARRAY laEnv[25]
SET LIBRARY TO FoxTools ADDITIVE
 
ACTIVATE WINDOW Command
&& Get the whandle for the current window
lnwhandle  = _WonTop()
lnResult = _EdGetEnv( lnwHandle, @laEnv )
&& Make sure that call succeed and the handle belongs to the Command Window
IF lnResult <> 0 AND laEnv[25]=0
	&& Font Name
	laEnv[22] = "Consolas"
	&& Font Size
	laEnv[23] = 13
	IF _EdSetEnv( lnwHandle, @laEnv ) <> 0 
		? "Success"
	ELSE
		? "Could not set Command Window Font"
	ENDIF	
ELSE
	? "Could not get Command Window handle"
ENDIF