External (DLL) gadgets question

BlitzMax Forums/BlitzMax Programming/External (DLL) gadgets question

Beaker(Posted 2005) [#1]
If I have a gadget attached to a Bmax window thru a DLL, is there anyway to get the external gadget to return events in BlitzMax (or some other communication mechanism)?

This is Windows only of course.


Perturbatio(Posted 2005) [#2]
I think you need to implement a message hook, probably using SetWindowsHookEx


Sarge(Posted 2005) [#3]
You have to create a window proceduer for the callback to catch the events of the gadget and a message handler.


skidracer(Posted 2005) [#4]
The function to call is:

Function PostGuiEvent( id,source:TGadget=Null,data=0,mods=0,x=0,y=0,extra:Object=Null )

which can be found in maxgui.mod/event.bmx file

PostGuiEvent%(id%,source:TGadget="bbNullObject",data%=0,mods%=0,x%=0,y%=0,extra:Object="bbNullObject")="brl_maxgui_PostGuiEvent"


and looking in the .i file the call from c should be to "brl_maxgui_PostGuiEvent", I think... I don't see how you could call this directly from a dll though


Beaker(Posted 2005) [#5]
If I get the hwnd of the external gadget into Bmax can I not construct an event system for it in Bmax itself? It is definitely triggering events, they just aren't very useful yet.


skn3(Posted 2005) [#6]
beak
http://www.blitzbasic.com/Community/posts.php?topic=53212

You can adapt the system used here to do it.


Beaker(Posted 2005) [#7]
Thanks skn3 - I'm not sure how to merge it all together to make it work. I was thinking that someone would've done something like this already, but it seems not.