FIX: Visual FoxPro 7.0 Behaves as if _Screen.AlwaysOnTop Is Set to True (320126)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 7.0

This article was previously published under Q320126

SYMPTOMS

When you run a Visual FoxPro 7.0 runtime executable or you use Visual FoxPro in development mode, the Visual FoxPro executable sometimes remains on top of any other Windows application. Visual FoxPro behaves as if the AlwaysOnTop property is set to true.

RESOLUTION

To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack

STATUS

Microsoft has confirmed that this is a problem in Microsoft Visual FoxPro for Windows 7.0.

This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.

MORE INFORMATION

  1. Paste the following code in a program (.prg) file, and then run the program from the Command window:
     
    DELETE FILE testxx.pjx
    CREATE PROJECT testxx NOWAIT 
    DELETE FILE testxx.prg
    
    TEXT TO lcVar NOSHOW 
    	lcScript = "_screen.AlwaysOnTop = .t."+CHR(13)+ ;
    	              CHR(10)+ "_Screen.AlwaysOnTop = .f."
       ON KEY LABEL f5 EXECSCRIPT(lcScript)
       ON SHUTDOWN QUIT
       _SCREEN.WINDOWSTATE = 0
       _SCREEN.VISIBLE = .T.
       READ EVENTS
    ENDTEXT 
    STRTOFILE(lcVar,'testxx.prg',0)
    _vfp.ActiveProject.files.add('testxx.prg')
    ?_vfp.ActiveProject.Build('testxx.exe')
    _vfp.ActiveProject.close
    RETURN
    					
  2. In Windows Explorer, double-click the folder that contains Testxx.exe, right-click Testxx.exe, and then click Create Shortcut.
  3. Right-click the Textxx.exe shortcut, click Properties, and then from the Run drop-down list box, click either Maximized or Minimized. Click OK.
  4. Double-click the Testxx.exe shortcut to run the executable.
  5. Open another Windows application, and note that the Visual FoxPro executable remains on top.

Modification Type:MajorLast Reviewed:5/13/2002
Keywords:kbbug kbCodeSnippet kbCtrl kbDSupport kbVFP700sp1fix KB320126