Intercepting events?

BlitzPlus Forums/BlitzPlus Programming/Intercepting events?

sswift(Posted 2005) [#1]
Has anyone ever done anything like intercepted events in Blitzplus before Blitzplus deals with them?

I thought someone had done this, or maybe intercepted keyboard input. I'm wondering if I could steal the ALT key from Blitz to keep it from using it to pause the app and activate the file menu.


Snarty(Posted 2005) [#2]
Yes, it's possible.

You need to subclass controls. This can be achieved by using SetWindowLong and the GWL_WNDPROC index. You then create your own proc in C/C++ etc (or any dll capable language) and you can pick and choose what you want B+ to see/control etc.


WolRon(Posted 2005) [#3]
Don't know if it would help, but could you kill the event by using PeekEvent to detect it, and then FlushEvents to kill it?


sswift(Posted 2005) [#4]
WolRon:
Doesn't work. And I can't make a DLL in C to do what Snarty suggests.


Arem(Posted 2005) [#5]
Setwindowlong is a user32.dll (I think) command. You can get a userlib in the userlibs section. MSDN library ought to have something on what it does.


Nicstt(Posted 2005) [#6]
just a thought from something i use try activating the main window:-
ActivateGadget mainwindow


Kev(Posted 2005) [#7]
i done something like this sometime back using win api's SetWindowsHookEx i used the WH_GETMESSAGE hook to hook blitzplus's messages. you might want to look into WH_KEYBOARD hook.

you could use the WH_CALLWNDPROC hook and grab all winproc messages before the system send's them to the destination window.

kev


Grey Alien(Posted 2005) [#8]
Kev: That sounds great, all we need is someone clever enough to code and post it. Any takers?