nevermind Posted August 24, 2009 Posted August 24, 2009 (edited) can we run autoit scripts with foxpro for windows? something like this. 1) open cmd.exe. run a few dos commands. 2) run foxprow.exe. this is something like dos based gui. 3) issue a few commands in foxpro software. 4) exit foxprow.exe 5) run more dos commands 6) close cmd thanks for help Edited August 24, 2009 by nevermind
ResNullius Posted August 24, 2009 Posted August 24, 2009 can we run autoit scripts with foxpro for windows? something like this.thanks for helpWhat version of Foxpro are you running? You say "2) run foxprow.exe. this is something like dos based gui".So I'm guessing it's an old(er) version?
ResNullius Posted August 25, 2009 Posted August 25, 2009 its version 2.6 Wow, 2.6 gives "Divide by Zero" errors when run on a modern CPU; I had to use a CPU throttling utility to get the program to launch at all. But, the Foxpro window and its controls are exposed to Au3Info tool, so scripting it isn't a problem: Opt("SendKeyDelay",0) Run("C:\FPW26\FOXPROW.EXE") WinWait("Microsoft FoxPro", "Command") WinActivate("Microsoft FoxPro", "Command") WinWaitActive("Microsoft FoxPro", "Command") Sleep(500) $hwndFpCmdWin = ControlGetHandle("Microsoft FoxPro","","[CLASS:Fox_000017161; INSTANCE:3]") ControlSend("Microsoft FoxPro", "Command",$hwndFpCmdWin,"CLEAR{ENTER}") ControlSend("Microsoft FoxPro", "Command",$hwndFpCmdWin,"?sys(2003){ENTER}") ControlSend("Microsoft FoxPro", "Command",$hwndFpCmdWin,"?sys(3){ENTER}") ControlSend("Microsoft FoxPro", "Command",$hwndFpCmdWin,"?DATE(){ENTER}") Sleep(500) ControlSend("Microsoft FoxPro", "Command", $hwndFpCmdWin,"QUIT{ENTER}")
nevermind Posted August 25, 2009 Author Posted August 25, 2009 thanks for you help. that was very useful. i just had one more question but its not very autoit related which is. can i perform steps 2, 3 and 4 all in one dos command? i.e open foxprow.exe, issue commands and close foxprow.exe. thanks again.
ResNullius Posted August 25, 2009 Posted August 25, 2009 can i perform steps 2, 3 and 4 all in one dos command? i.e open foxprow.exe, issue commands and close foxprow.exe.Ehmmm... why don't you just create a Foxpro program with your required Foxpro commands, compile it in Foxpro, and then call that executable from AutoIt with Run() or RunWait()?Or are they wildly different commands to be executed each and every time?If you can give me an idea of what you're using the Foxpro commands to do, I might be able to offer more insight.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now