DECLARE INTEGER ShellExecute IN "Shell32.dll" ; INTEGER HWND, ; STRING lpVerb, ; STRING lpFile, ; STRING lpParameters, ; STRING lpDirectory, ; LONG nShowCmd = ShellExecute(0, "open", "osk.exe", '', "", 0) * The below is just for test purposes to give the * on-screen keyboard a chance to actually load and display * before VFP tries to find its window handle i = 0 DO WHILE i < 100000 i = i + 1 ENDDO * See if the On-Screen Keyboard is running and if so, close it lcWindow = "On-Screen Keyboard" lnHand=CheckWin(lcWindow) #DEFINE WM_QUIT 0x12 DECLARE SHORT PostMessage IN USER32.DLL ; INTEGER HWND, ; INTEGER uMsg, ; INTEGER wParam, ; INTEGER LPARAM IF UPPER(TYPE('lnHand'))="N" .AND. lnHand > 0 =PostMessage(lnHand,WM_QUIT,0,0) ENDIF RETURN PROCEDURE CheckWin PARAMETER tcTitle DECLARE INTEGER FindWindow IN Win32API AS FindWindow STRING, STRING lnHand=FindWindow(0,tcTitle) RETURN lnHand