Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Highlight a minimized App
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00697567
Message ID:
00698489
Vues:
18
Ed, thank you for your reply and for going into such detail.
I understand what you are saying and can see merits in your approach.

The immediate problem that I have , is ,I think , more straightforward.

To summarize, whet I need is a way of Maximizing Myapp (not another app) and bringing it forward as the main window . I dont need to have access to any other processes at all.

If I can recap:-

I have a Foxro App running,mimimized, and on a timed event, say evry 30 minutes, it searches for a particular type of record on a file. If is is found, I want (1) The app to be maximized (2)The app to be brought forward as the front most window so it gets the operators attention (3) It does not need to even be aware of any other processes running except to the extent , that when the evnt firs, the app becomes foremost.

My only problem up to now is I dont know how to bring the window forward



Regards,

Gerard
_____________________________________________________________________________












>>Ed, I have the wsh script running,but it will only show if the app is not mimimized.
>>
>>Is there a way to show the app if it is running minimized?
>>
>
>Gerard,
>
>This is not going to be a popular reply, but it needs to be said. You're trying to approach the problem in the completely wrong fashion here. You face a terrible problem attempting to manipulate anonymous things running in the operating system, often by their visible Windows. Instead of this anonymity, you should be looking for a way to create a causal link between those OS processes your app launches and you application. And the way to do that is to not use anonymity.
>
>You face the problem of find the hWnd of a given process's main Window by name, even when that may not provide suitable identity. That's a good observation - what the executable is does not provide sufficient granularity to manipulate the external tasks the way you'd like. Time to find another way.
>
>Each process that gets launched has its own unique identifier that references it. Wouldn't it be nice to record that moniker somehow, and then use it to do what you want?
>
>(I'll assume the answer is yes.) VFP's RUN command doesn't do this for you. ShellExecute() gives us back pseudohandles that identify whether a process was started, but gives us no handle on the process's progress. Wscript.Shell gives us a firm grip on a single running application, but only if launched modally. What to do?
>
>Enter API_APPRUN...a class which is used to run executables from within VFP in a modal or non-modal fashion. It is able to track whether or not a process is running at any given moment...sounds like a solution!
>
>API_APPRUN relies on the native OS CreateProcess() API call. This is documented in the code and in the referenced MSDN docs, as well as a lot of other places (not in the VFP realm.) CreateProcess() tracks both the process and it's initial thread by both id and handle - and these can be used to check whether a window belongs to a given process, or to terminate a process without even the need to find a window. Simply create a API_APPRUN object, use it to run a given app, and then use the object to see if it's still running, what its process id and handle are, and if necessary to blow it out of the water without a secod thought. As long as you haven't tossed away the API_APPRUN object, you have gthe non-anonymous capability you need.
>
>Isn't this a better way to handle your problem than by trying to winkle which of 12 identical twins is the one you want to terminate?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform