>tcWindow="Test App" >DECLARE INTEGER FindWindow IN Win32API STRING, STRING >DECLARE INTEGER SetForegroundWindow IN "User32.dll" INTEGER >HWND = FindWindow(0,tcWindow) >=SetForegroundWindow(HWND) >INKEY(3) > >KEYBOARD("1") >>
* Create the Shell reference oShell = CREATEOBJECT("WScript.Shell") DECLARE Sleep IN Win32API; INTEGER dwMilliseconds oShell.Run("Notepad") oShell.AppActivate("Untitled – Notepad") = Sleep(100) && Pause VFP for a 1/10 of a second oShell.SendKeys("This sends a sentence to Notepad from VFP.~")Naturally, this requires that the WSH be installed. You can find the articles on-line at www.vfug.org