Page 1 of 1

Adding gadgets to other windows

Posted: Sat Oct 04, 2003 6:56 pm
by twobits
Hi everyone,
Is it possible to add a gadget to another window? i.e i get window handle of another window using findwindow, is it now possible for me to add controls to that window which can be controlled from within my pb program?
Thanx

Posted: Sat Oct 04, 2003 7:04 pm
by freak
It is possible to add Gadgets to a window that was not created with PB's
window functions. For that, you just use CreateGadgetList(WindowHandle).
But it is not possible to add a Gadget to a window of another application.
That won't work.

Timo

Posted: Sat Oct 04, 2003 7:18 pm
by twobits
What do you mean by a window not created in pb? isnt that another apps window?
Could i create a panel control in vb, and then draw a control on it from PB by getting the hWnd?

I know something like that is possible - as the little monitor in screen saver settings works something like it.

Posted: Sat Oct 04, 2003 10:19 pm
by twobits
Ok - ive managed to draw controls on a panel control running in a vb app - but is it possible to recieve any events from these controls? or do the events get sent to the vb app instead?

Posted: Sun Oct 05, 2003 12:23 am
by Doobrey
twobits wrote:What do you mean by a window not created in pb? isnt that another apps window?
He meant windows that are created using the API instead of PB`s built in window commands.

As for getting that gadgets events, I think it`s possible (although I haven`t tried it), have you tried setting a callback procedure for the gadget?

Posted: Sun Oct 05, 2003 10:26 pm
by twobits
So is it possible to create a panel gadget and get the window handle of the panel gadget, then set that as the current window and set up a call back function associated with the panel?