Gary
Mon Jul 12 22:55:16 CDT 2004
"Hu Dong" <hdong@ucdavis.edu.INVALID> wrote in message
news:eaGGB2HaEHA.3012@tk2msftngp13.phx.gbl...
> Thanks for your reply. Gary.
> It is a long story why I need to get a window handle from an instance
> handle. I want to call UpdateWindow() in a dialogbox I developed to
repaint
> a window B which was developed by the third party. What I need is the
handle
> to that window B. I know nothing about their works but their program calls
> my dialog boxes. So what I am trying to do is, to find out the instance to
> that program (third party program) by GetModuleHandle(), and then to find
> out the handle to that window B through the way stated in the knowledge
base
> article 242308.
>
> Do you have any comments? Ideas?
That must be a very old article. GetWindowThreadProcessID doesn't
return an instance handle in Win32. It returns a Process ID and a Thread ID
(the first is returned in the variable pointed to by lpdwProcessId).
It looks like the program does the right thing even though the text uses
obsolete terms. Someone probably did a half-hearted job of modernizing it.
I think if you simply substitute ProcessID for hInstance, it will make more
sense.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
-
http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@mvps.org