General information
Category:
Coding, syntax & commands
>>VFP 5.0. From within a main exe i call a second exe (VFP exe), with the command
>>! N7/ second.exe, clicking on a commandbutton.
>>Sometimes if i click on a main form before the second exe appearing, the second exe is showed behind the first.
>
>You're starting a separate executable and Window that runs disjoint from the first application, and you've done nothing to coordinate the two apps or establish which will be the foreground task. There are a number of API calls related to establishing the ZOrder of various application's top-level Windows such as ShowWindow(), SetActiveWindow(), SetForegroundWindow() and the like; you'll need to experiment with them. There's no provision internal to VFP using only native VFP code to coordinate the separate processes.
>
>If you want to run the second executable with an apparent Modal behavior relative to the first, you might experiment with using my API_APPRUN class in the Files Section; it has the ability to start a WinApp and wait on it's termination before returning to the calling VFP app, unlike run with the /N switches. You also might want to look at using The Windows Script Host's Wscript.Shell object; it can start (and wait on termination if desired) a WinApp, and can cause the activation of an app based on the primary Window's titlebar for a given application. There are links in my signature block to several WSH resource sites.
>
>>Always on top does not help me.
>>Some suggestion?
>>Thanx
Hi Ed,
Thanks for your reply. I've tried your api_apprun. But it does no help me, because 'lunchappandwait' just call the exe and wait. But it don't do nothing to put the called exe as the top of the screen:am i wrong?
I did not find ShowWindow() SetActiveWindow and so on. Have you some code example, or can you tell me where I should search for this?
I just want an exe not underground!
Thanx in advance
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only