[lazarus] Creating Components...
Shane Miller
smiller at lakefield.net
Wed Aug 11 22:36:11 EDT 1999
>My problem is the way in which messages are sent to create the button. The
>first message sent is the LM_CREATE, then the LM_ADDCHILD to tell the
>button what it's parent is. However, win32 wants to know the window handle
>of the button's parent when the button is created. I don't have that
>information yet!!! I won't get that until the LM_ADDCHILD message is
>recieved. I have all of the other data needed, such as the size and the
>position of the button, but not the parent. The net result is that I get
>the main form and a very small form that contains the button, since windows
>creates a form to go around the button because it has no parent.
If you are using the SENDMESSAGE3 procedure to call LM_CREATE, then you are
sending SELF. The TButton has a owner property that is a TControl and
tcontrol's have handles.... See how you get the handle from that?
Wherever the SendMessage3(LM_Create,Self) is, make sure the TCOntrol was
created because that's where the FOWNER is set (I think) and the owner
property can be typecast to a TControl to get it's handle....
Shane
More information about the Lazarus
mailing list