How to capture window message in B3D window?

Archives Forums/Blitz3D SDK Programming/How to capture window message in B3D window?

MeowZ(Posted 2007) [#1]
Hi guys,

Anyone knows how to capture windows message in B3D window? such as WM_INPUT.

Thank you very much


ninjarat(Posted 2007) [#2]
No, but I do know there is an example for it in the Blitz3DSDK examples. Poke around.


MeowZ(Posted 2007) [#3]
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?


MeowZ(Posted 2007) [#4]
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,


ninjarat(Posted 2007) [#5]
Hmm. I'm not sure then... Anyone else got an idea?


@rtur(Posted 2007) [#6]
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.


ninjarat(Posted 2007) [#7]
That's what I was talking about. Perhaps it is not an official example then?


MeowZ(Posted 2007) [#8]
Thanks so much guys. I will try to implement it in VC++ then be back to tell you how it works.


Barnabius(Posted 2007) [#9]
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


MeowZ(Posted 2007) [#10]
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.


MeowZ(Posted 2007) [#11]
All problems is fixed, anyone interested let me know.

cheers,