ProcedureDLL GadgetI()
If WindowEvent() = #PB_Event_Gadget
ProcedureReturn EventGadgetID()
EndIf
EndProcedure
Alrighty... for some reason that code wont work... =\ The whole WindowEvent() command wont work... I tried using the WaitWindowEvent() command but it gave me a serious slowdown... =\ I think it dropped 200 FPS in the program thats calling the dll... (big problems)...
o_O but the command says it will get an activity in any window... O_O I guess I missunderstood (I really don't want to trust basic programming languages with pointers... o_O could get to be quite a mess...)
Yuo have to remember that the DLL is not running with your program, it is a separate process, therefore unless you open the window inside the DLL you have to pass the pointer
ProcedureDLL GadgetI(WinID)
If Check
UpdateWindow_(WindowID(WinID))
EndIf
Delay(1)
EventID.l = WindowEvent()
If EventID = #PB_Event_Gadget
ProcedureReturn EventGadgetID()
EndIf
EndProcedure
Success... this works... =\ but I would prefer one that doesn't drop my other program from 250 fps to 220 fps... heh... oh well... it works... O_O took me long enough... I had to search the forums a couple times until I found something about it...
ACK... my lil function there isnt as reliable as I thought... it works I'd say 90% of the time... but unless I'm mistaken its missing some of the events... =\ you have anything that works better (without any kind of loop in the procedure... its murder for my main app ... =P)
DarthPuff wrote:OH... and I was wondering if it was possible to find the main app windows address and make gadgets and stuff appear in it... =\ hehe...
Yes.
Use the same method has above.
Open the window in the main exec, then pass it's pointer to the DLL, then inside the DLL create the gadgets
=\ I still don't have a clue about getting the pointer in this version... o_O I mean... once I get the pointer what do I do with it??? and how do I get it in PB... I understand pointers in C++ (but I prefer references)... ack...