Page 1 of 1
WindowEvent()?
Posted: Sat Jul 05, 2003 10:41 am
by DarthPuff
Code: Select all
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)...
Posted: Sat Jul 05, 2003 11:14 am
by Num3
Hi...
You need to pass the pointer of the window into your dll.
Imagine a DLL has another program, you need to send it the variables of your main app for it to know where to look
I'll post some examples later on...
Posted: Sat Jul 05, 2003 11:23 am
by DarthPuff
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...)
Posted: Sat Jul 05, 2003 12:41 pm
by Num3
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

Posted: Sat Jul 05, 2003 10:48 pm
by DarthPuff
Ack... So how would I go about doing that... =P
Posted: Sun Jul 06, 2003 9:48 am
by DarthPuff
Code: Select all
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...
Posted: Sun Jul 06, 2003 9:50 am
by DarthPuff
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...
Posted: Sun Jul 06, 2003 9:56 am
by DarthPuff
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)
Posted: Sun Jul 06, 2003 12:45 pm
by Num3
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

Posted: Mon Jul 07, 2003 12:24 am
by DarthPuff
=\ 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...