Hi Houston,
Thanks for the points conveyed.
Aashish
>>Not an API guy hence not a solution in API.
>>Try
>>KEYBOARD '{ALT+TAB}'
>>Can work if only two application is open.
>>Aashish
>
>Thanks for the response. A few small points:
>1. KEYBOARD only sends key strokes to VFP's internal message processor, not to the OS.
>2. The key label '{ALT+TAB}' is invalid.
>3. If you look at the online help for INKEY() you will see that there is no code for ALT, since it is reserved for the OS.
>
>No cigar today.
>
>I have some Win32 code that (if I can be bothered to dig it out) can send the required key strokes (to the OS). Windows Script Host, appears to need a handle (to a target App's Window) to which key strokes are sent - that does not look like it is going to work. Either way, this was only going to be a short lived thing - sufficient code should be transferred to the VFP App, that the DOS App (or a portion of it, and the need to switch between them) will become redundant, some time next week.
>
>>>I have a Fox for DOS App that uses the RUN command to start a VFP app (to do some printing of labels) at one site if the Fox for DOS App is running Full Screen, then the transition to VFP is not sucessful and I have to use Win32 SetForegroundWindow to get VFP to stay in the foreground.
>>>
>>>When VFP is finished, control should automatically return to the Fox for DOS App. This does not happen. I've tried
oWSH = CreateObject( "WScript.Shell" )
>>>oWSH.AppActivate( "Command Prompt - FOXPROX" )
>>>
>>>Also tried
DECLARE INTEGER GetLastError IN WIN32API
>>>DECLARE INTEGER FindWindow IN WIN32API STRING, STRING
>>>DECLARE INTEGER SetForegroundWindow IN WIN32API INTEGER
>>>DECLARE INTEGER ShowWindow IN WIN32API INTEGER, INTEGER
>>>
>>>cWindowTitle = "Command Prompt - FOXPROX"
>>>hDOSApp = FindWindow( .NULL., cWindowTitle + CHR(0) )
>>>
>>>IF hDOSApp == 0 THEN
>>> MESSAGEBOX( "Unable to automatically maximize your DOS application. " ;
>>> + TRANSFORM( GetLastError() ) ;
>>> , 64 + 0 )
>>> QUIT
>>>ENDIF
>>>
>>>iResult1 = ShowWindow( hDOSApp, 1 )
>>>iResult2 = SetForegroundWindow( hDOSApp )
The MessageBox displayed above shows error number 127 (Unable to find procedure). This works when done from the command window.
>>>
>>>Does anyone have any suggestions?