Path: utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!gem.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!wuarchive!texbell!texsun!csccat!jack From: jack@csccat.UUCP (Jack Hudler) Newsgroups: comp.os.os2 Subject: Re: HWND from PID Keywords: HWND PID Message-ID: <3397@csccat.UUCP> Date: 18 Nov 89 02:06:15 GMT References: <21069@ut-emx.UUCP> Reply-To: jack@csccat.UUCP (Jack Hudler) Distribution: comp.os.os2 Organization: Computer Support Corporation. Dallas,Texas Lines: 35 In article <21069@ut-emx.UUCP> hdan@walt.cc.utexas.edu (Dan Higdon) writes: >Ok, all you Microsoft people out there, here's a fun one.... > >How can I find the Window ID of a Child process? I can (obviously) >get the PID from my DosExecPgm call, but how can I then get a handle >on the new process's window? I KNOW there must be a call for this, >but I can't find it in the INDEX... :-# > >I know I could enumerate all the top level windows and try to find the >one I'm looking for, but that seems a little barbaric. > >Another, related question: When you ExecPgm a new process ASYC, does >it continue to run after the parent dies? (please say yes.) > >Thanks in advance for your help! > >hdan@sleepy.cc.utexas.edu (Really Dan Higdon) I don't know how to do what your asking.. but try this. In the parent and child do: hAtomTbl = WinQuerySystemAtomTable(); WM_Your_atom = WinAddAtom(hAtomTbl,"SOMENAMEYOUCHOOSE"); Have the child when able do a broadcast message that only the parent would know. WinBroadcastMsg(hWnd,WM_Your_atom,MPFROMHWND(hWndChildFrame),0L,BMSG_POSTQUEUE); And in the parent be ready to recieve the message, in this example mp1 would contain the window handle. Once you have this a more private comunication can take place. -- Jack Computer Support Corportion Dallas,Texas Hudler UUCP: {texsun,texbell,attctc}!csccat!jack