How to capture window message in B3D window?
Archives Forums/Blitz3D SDK Programming/How to capture window message in B3D window?
| ||
Hi guys, Anyone knows how to capture windows message in B3D window? such as WM_INPUT. Thank you very much |
| ||
No, but I do know there is an example for it in the Blitz3DSDK examples. Poke around. |
| ||
I reviewed all of the examples but there was nothing relate to capturing windows message, such as WM_PAINT, WM_COMMAND, WM_INPUT. I want to use WM_INPUT message as RAW input for game controller devices, such as dual light guns. Anyone could help? |
| ||
In addition, I have worked around by the information I got from this site http://jstookey.com/arcade/rawmouse/ for a week but could not solve the problem. thank you, |
| ||
Hmm. I'm not sure then... Anyone else got an idea? |
| ||
You can set your function to handle window messages, and then send them to blitz3d native message handling function: BlitzProc = SetWindowLong_(hWnd, #GWL_WNDPROC, @WindowCallBack()) Procedure WindowCallBack(hWnd.l, uMsg.l, wParam.l, lParam.l) Select uMsg ...Your code for messages here.... EndSelect ProcedureReturn CallWindowProc_(BlitzProc, hWnd, uMsg, wParam, lParam) EndProcedure SetWindowLong is WinAPI function, from user32.dll This example in PureBasic. |
| ||
That's what I was talking about. Perhaps it is not an official example then? |
| ||
Thanks so much guys. I will try to implement it in VC++ then be back to tell you how it works. |
| ||
That is basically a standard method used for subclassing and for some reason it does work for me in EBasic. And it's not EBasic's fault as I am using subclassing with it all the time. Barney |
| ||
Hi Guys, I tried with B3D VC++ sample in the SDK. The problem is I cannot file window handle (hWnd) of the B3D's window to capture standard windows message - -a. // Begin Blitz3D bbBeginBlitz3D (); bbGraphics3D(640,480,0,2); Anyone could help? Thank you. |
| ||
All problems is fixed, anyone interested let me know. cheers, |