GadgetParent()
BlitzPlus Forums/BlitzPlus Programming/GadgetParent()
Man, I rule so much...
Function GetGadgetParent(gadget)
Return PeekL(gadget+28)
End Function
Function GadgetParent(gadget,parent)
SetParent QueryObject(gadget,1),QueryObject(parent,1)
PokeL gadget+28,parent
End Function
Or you could just stick this in user32.decls:
GetParent%(hwnd%)
And call this function:
Function GetGadgetParent(Gadget)
Return GetParent(QueryObject(Gadget, 1))
End Function
But you rule too much to do that. :-)
That doesn't return the Blitz gadget, dumbass.
lol, nothing is so much fun as halo vs sswift in a handbags at dawn spit for spat..
Yeah, I guess I am a dumbass. I misinterpreted what you wanted to do. Sorry!
What I should have said was:
Why do all that when you can just use the GadgetGroup() command?
GadgetGroup(gadget)
Parameters
gadget - A gadget handle
Description
GadgetGroup returns the group the gadget belongs to - ie: its 'parent' gadget.
Dumbass. :-)
Oh, the irony is killing me....
Sswift, you ow me a new keyboard.. got coke all over it now..
Tracer
.
Has that command always been there?
ANyways, this will set the parent:
Function SetGadgetGroup(gadget,parent)
SetParent QueryObject(gadget,1),QueryObject(parent,1)
PokeL gadget+28,parent
End Function
Just make sure you restore it befgore closing the program.
I think GradgetGroup is rather new. Where does your SetParent function come from!?
That's what I thought.
SetParent is in user32.dll.