Intercepting events?
BlitzPlus Forums/BlitzPlus Programming/Intercepting events?| 
 | ||
| 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. | 
| 
 | ||
| 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. | 
| 
 | ||
| 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? | 
| 
 | ||
| WolRon: Doesn't work. And I can't make a DLL in C to do what Snarty suggests. | 
| 
 | ||
| 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. | 
| 
 | ||
| just a thought from something i use try activating the main window:- ActivateGadget mainwindow | 
| 
 | ||
| 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 | 
| 
 | ||
| Kev: That sounds great, all we need is someone clever enough to code and post it.  Any takers? |