Google Groups Home
Help | Sign in
Message from discussion SetWindowLong and GWL_HWNDPARENT
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Tom Esh  
View profile
 More options Nov 9 1999, 3:00 am
Newsgroups: microsoft.public.vb.winapi
From: 76467.1255gibber...@compuserve.com (Tom Esh)
Date: 1999/11/09
Subject: Re: SetWindowLong and GWL_HWNDPARENT
>"You must not call SetWindowLong with the GWL_HWNDPARENT index to change the
>parent of a child window. Instead, use the SetParent function. Instead, use
>the SetParent function."

(In)famous misleading statement. Almost as misleading as the choice of
GWL_HWNDPARENT as the name. It has nothing to do with a window's
parent. It really changes the Owner, which (in VB5 or later) is
exactly the same thing as including the Owner argument in the Show
statement.
A more accurate version might be..
"SetWindowLong with the GWL_HWNDPARENT will not change the parent of a
child window. Instead, use the SetParent function. GWL_HWNDPARENT
should have been called GWL_HWNDOWNER, but nobody noticed it until
after a bazillion copies of the SDK had gone out. This is what happens
when the the dev team lives on M&Ms and CocaCola for to long. Too bad.
Live with it."
<g>

On Tue, 9 Nov 1999 13:40:31 -0500, "Bob" <b...@softchoice.com> wrote:
>I found the following information on the MSDN website:

>"You must not call SetWindowLong with the GWL_HWNDPARENT index to change the
>parent of a child window. Instead, use the SetParent function. Instead, use
>the SetParent function."

>Unfortunately, there is no further explanation. Can anyone provide more
>details on this?

>I'm calling SetWindowLong with the GWL_HWNDPARENT index in one of my
>applications because the child window can be placed outside the parent form.
>When using SetParent, the child form stays inside the parent form.

>Thanks, Bob

-Tom
(remove gibberish for e-mail repl)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google