Apparently, the borders of some forms don’t get painted correctly on Windows Vista.
When executing a Fox Form, Fox asks Windows to create a window, then sets the BorderStyle of the window. Apparently, under Vista Aero (except as Administrator), the BorderStyle cannot be set after the Window has been created.
To reproduce the problem, start Visual FoxPro (I tried back to VFP7 (released summer 2001))
Amazingly enough, run under Admin mode, and you’ll see the problem disappear. Perhaps a non-admin app changing the BorderStyle might be a security risk: An app might be able to grab a window handle from another process and impersonate a Credentials screen or something.
When Fox runs a form, it reads the Properties and sets them in the order encountered. For a Form, the “DoCreate” pseudo property means to create the window. The BorderStyle happens to be written after the DoCreate, so the BorderStyle setting is ignored
The properties look like this before the fix:
Top = 0
Left = 0
Height = 250
Width = 375
DoCreate = .T.
BorderStyle = 1
Caption = "Form1"
Name = "Form1"
So your choices are:
Program starts below (and works in VFP7 too)
FixDir(CURDIR()) && Call recursive program with current directory
*Recursive program to fix all forms found in cPath and subdirectories
* Fix Vista Aero Border painting by changinge DoCreate and BorderStyle order
PROCEDURE FixDir(cPath) && Fix all forms in directory cPath and subdirectories
n=ADIR(aFiles,cPath+"*.scx") && look in current dir for all form files (.SCX)
FOR i = 1 TO n
USE (cPath+aFiles[i,1]) ALIAS SCX && open the form as a table
SCAN FOR !EMPTY(Properties) AND ATC("DoCreate",Properties)>0 && locate the Properties
nLines = ALINES(aProps,Properties) && Create an array of all the lines in the Properties
FOR j = 1 TO nLines && Loop through and record the array indices of DoCreate and BorderStyle
IF nDoCreate > 0 AND nDoCreate < nBorderStyle && If DoCreate precedes BorderStyle, insert BorderStyle before
FOR nIndex = 1 TO nLines && now emit the properties in the desired order
CASE nIndex = nDoCreate
CASE nIndex = nBorderStyle
* do nothing: already added
REPLACE Properties WITH cTemp && and update
USE IN SCX && close the file
n=ADIR(aFiles,cPath+"*.*","D") && Get any subdirs
IF ATC("D",aFiles[i,5])>0 AND aFiles[i,1] != "."
FixDir(cPath+aFiles[i,1]+"\") && recur
</end of program>