Re: VB6 Restore Minimized Window - External Application
From: Tom Esh (tjeshGibberish_at_earthlink.net)
Date: 10/05/04
- Next message: Tom Esh: "Re: What is the hex value of the enum WM_KEYPRESS?"
- Previous message: Amit Dandavate: "Re: Pass parameters to the application which is already running"
- In reply to: Andrew Dunn: "Re: VB6 Restore Minimized Window - External Application"
- Next in thread: Andrew Dunn: "Re: VB6 Restore Minimized Window - External Application"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 05 Oct 2004 07:58:02 -0400
On Tue, 5 Oct 2004 10:51:38 +0100, "Andrew Dunn"
<andrewd@cclXXXmenzies.com> wrote:
>
>I know the EXE name of the application that I want to call. I have no method
>of predicting what the form.caption will be.
>
>I have worked around this problem for now by amending the applications that
>will be called so that they write their current caption to a registry key.
>My calling program now uses the EXE name to retreive the registry key and
>then I can find my window handle.
>
>Knowing the EXE name and knowing that only one copy of the EXE will be
>running, given that I can identify the process, is there anyway of finding
>out the caption ?
>
>I will look at the FindPart example - though I suspect that I already have
>most of the code - i.e. I can already find a partial caption.
Offhand the only way I know would be to enumerate the running
processes with...
CreateToolhelp32Snapshot
Process32First
Process32Next
...until you find one with the correct exename. Stash the process ID
from that, then enumerate the top-level windows with EnumWindows until
you get one who's PID matches.
Of course if your app is launching the exe, VB's shell or several Api
methods can provide the PID at that time, and you could skip the
process enumeration part.
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
- Next message: Tom Esh: "Re: What is the hex value of the enum WM_KEYPRESS?"
- Previous message: Amit Dandavate: "Re: Pass parameters to the application which is already running"
- In reply to: Andrew Dunn: "Re: VB6 Restore Minimized Window - External Application"
- Next in thread: Andrew Dunn: "Re: VB6 Restore Minimized Window - External Application"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|