SetBlitz3DEventCallback and SetBlitz3DHWND Bug

Blitz3D SDK Forums/Blitz3D SDK Bug Reports/SetBlitz3DEventCallback and SetBlitz3DHWND Bug

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Mark

You are genius! That works like a dream, all you need to do is add the following import somewhere in your class.
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern IntPtr SetFocus(int hWnd);


Then in your Blitz3DEventCallback function just do the following:
SetFocus( hWnd );


[*EDIT*] You need to keep track of the focus for the render target because setting focus to the render target every time the callback is fired will result in your other controls not being able to recieve keyboard focus i.e. a textbox

e.g.
if( m_b_b3d_has_focus )
      SetFocus( hWnd );

[*END EDIT*]

Now all events are recieved including keyboard.

Thanks Mark.


Moraldi,

It was a problem with .NET (C#, VB.NET etc) taking control of the message loop like Mark said.