Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loosing focus when running another exe
Message
From
11/04/2014 02:13:55
 
 
To
10/04/2014 19:36:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01598480
Message ID:
01598486
Views:
43
>From my VFP application I am running another executable using ! /N7 xyz.exe. The executable is a background process without a window, but when running the executable it results in losing the focus of the VFP application. So the user must click on the form again to continue working. I try to set the focus to a textbox on the form, but the application itself does not have focus anymore.
>The best would be if the focus would not go away in the first place, but I tried different ways and could not succeed. Any ideas?
*ShellX.prg:
*To use:
*
*lcProg = 'Yourpath\yourprog.exe'
*lcPar = 'some parameters' && Drop this line if no parameters
*ShellX(lcProg, lcPar)
Lparameters tcURL, tcParameter
if empty(tcParameter)
   tcParameter = ''
Endif
#define SW_HIDE 0
#DEFINE SW_SHOWNORMAL 1
#DEFINE SW_SHOWMINIMIZED 2
#DEFINE SW_SHOWMAXIMIZED 3
*!*   Legal verbs: open, edit, print, find, explore, NULL
DECLARE INTEGER ShellExecute IN shell32.dll ; 
   INTEGER hndWin, STRING cAction, STRING cFileName, ; 
   STRING cParams, STRING cDir, INTEGER nShowWin
ShellExecute( 0, "open", tcURL, tcParameter , "", SW_SHOWNORMAL )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform