Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bring app back 'on top' after running an external proces
Message
De
14/05/1999 10:38:06
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00218575
Message ID:
00218999
Vues:
19
>Ed:
>
>>Be aware that the behavior of SetForegroundWindow changed in Win98 and later releases;
>
>Thanks for the tip. If I was running a VFP application and then ran an external process which took about 15 minutes. While the external process was running I decided to edit a document in Word. I would probably not want to have the VFP application suddenly popup while typing in Word.
>

I've got a good solution for that - take a look at API_APPRUN, which has a LaunchAppAndWait() - makes VFP wait on the application it starts to completely close before proceeding, unless you explicitly select VFP as the foreground window and press Escape - you might be able to get LaunchAppAndWait(0 to respond to a SendMessage(), but I haven't tried. Works fairly well; certainly better than the VFP Run command.

>--Paul
>
>>>Mark:
>>>
>>>Try using the API calls:
>>>DECLARE INTEGER FindWindow IN WIN32API STRING cNull, STRING cWinName
>>>DECLARE INTEGER SetForegroundWindow IN WIN32API INTEGER hWinHandle
>>>DECLARE INTEGER ShowWindow IN WIN32API INTEGER, INTEGER
>>>
>>
>>Be aware that the behavior of SetForegroundWindow changed in Win98 and later releases; the system now restricts the processes that can set the foreground window. See the MSDN entry for SetForegroundWindow for details; basically, if VFP is in the background, it can't force itself to the foreground under Win98 unless there is no other program in the foreground or VFP was the last process to receive any input event.
>>
>>>There are good examples in the files section of this forum.
>>>
>>>HTH,
>>>
>>>--Paul
>>>
>>>>Can anyone tell me how to put my foxpro app back 'on top' after running an external process? (I'm calling an external process via
>>>>CreateProcess which I want to hide behind my foxpro app.) Due to the
>>>>nature of the external application I don't have control over its
>>>>window state so minimizing it isn't an alternative. Even if I could
>>>>minimize it my foxpro app still doesn't get the focus back.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform