Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application
Message
From
23/10/2002 23:20:14
 
 
To
23/10/2002 09:37:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00714089
Message ID:
00714644
Views:
14
>How can I issue an ALT-F4 command after the GETFILE() dialog is on top? I have tried placing the command in a Timer event but is not working. Any suggestions?

Try launching a script to do it before launching the GETFILE() to create an external timeout, something like the following; please excuse any typos, since I'm working in two of the languages I've used least recently, VBScript and VFP:
cScript = [Set WshShell = Wscript.CreateObject("WScript.Shell") + CHR(13) + CHR(10) + ;
Wscript.Sleep 20000  + CHR(13) + CHR(10) + ;
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject") + CHR(13) + CHR(10) + ;
If Not FSO.IsFile("C:\GotAFile") THEN + CHR(13) + CHR(10) + ;
WshShell.AppActivate "Open" + CHR(13) + CHR(10) + ;
WshShell.SendKeys "%{F4}"  + CHR(13) + CHR(10) + ;
End If  + CHR(13) + CHR(10) + ;
WshShell = Nothing  + CHR(13) + CHR(10) + ;
FSO = Nothing]
IF FILE('C:\GotAFile')
   ERASE C:\GotAFile
ENDIF
=StrToFile(cScript,'MYVBSCRIPT.VBS')
! /N7 CSCRIPT.EXE MYVBSCRIPT.VBS
ax=getf()
IF ! ISEMPTY(ax)
   =strtofile('','c:\gotafile')
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform