Changing Command Window Font Programmatically

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

for more info.


$SAMPLECODE$

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

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	


Comments