
Signature
----------------------------------------------------------------------
Thorsten Albers albers(a)uni-freiburg.de
----------------------------------------------------------------------
> Dean Earley <dean.earley@icode.co.uk> schrieb im Beitrag
> <egwSgi4AJHA.272@TK2MSFTNGP04.phx.gbl>...
[quoted text clipped - 5 lines]
> So we need more code to find the problem (including the declarations of
> joySetCapture() and joyReleaseCapture()).
Declarations:
Private Declare Function joySetCapture Lib "winmm.dll" (ByVal hWnd As
Long, ByVal uJoyID As Long, ByVal uPeriod As Long, ByVal fChanged As
Long) As Long
Private Declare Function joyReleaseCapture Lib "winmm.dll" (ByVal uJoyID
As Long) As Long
'Capture the joystick
If joySetCapture(CaptureForm.hWnd, IntIndex, 100, -1) = 0 Then
Captured = True
End If
Private Function SubClassed_WindowProc(ByVal hWnd As Long, ByVal Msg As
Long, ByVal wParam As Long, ByVal lParam As Long, Handled As Boolean) As
Long
Select Case Msg
Case MM_JOY1MOVE, MM_JOY1ZMOVE, MM_JOY1BUTTONDOWN, MM_JOY1BUTTONUP,
MM_JOY2MOVE, MM_JOY2ZMOVE, MM_JOY2BUTTONDOWN, MM_JOY2BUTTONUP
RaiseEvent JoystickEvent(Msg, wParam, lParam)
Handled = True
End Select
End Function
'Release the capture
If Captured Then
joyReleaseCapture IntIndex
Captured = False
End If
IntIndex is 0 for the first device, and ReleaseCapture() returns 0 every
time.
All my code did on reception of the event was beep which it does
profusely the first time I capture it, but never on subsequent attempts.
There is no other code involved in the capture, and I'm not the only
person to have seen this (although I can't find the post now)
The results are the same regardless of the interval, changed flag or the
threshold so they are not the problem.

Signature
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
iCode Systems
Thorsten Albers - 21 Aug 2008 20:16 GMT
Dean Earley <dean.earley@icode.co.uk> schrieb im Beitrag
<ut4UJq6AJHA.908@TK2MSFTNGP03.phx.gbl>...
> Private Function SubClassed_WindowProc(ByVal hWnd As Long, ByVal Msg As
> Long, ByVal wParam As Long, ByVal lParam As Long, Handled As Boolean) As
[quoted text clipped - 6 lines]
> End Select
> End Function
- Do you pass the messages after your own processing to the default window
procedure?
- At which point do you remove the subclassing of the window: before or
after joyReleaseCapture() is called?

Signature
----------------------------------------------------------------------
Thorsten Albers albers(a)uni-freiburg.de
----------------------------------------------------------------------
Dean Earley - 22 Aug 2008 08:48 GMT
> Dean Earley <dean.earley@icode.co.uk> schrieb im Beitrag
> <ut4UJq6AJHA.908@TK2MSFTNGP03.phx.gbl>...
[quoted text clipped - 11 lines]
> - Do you pass the messages after your own processing to the default window
> procedure?
No as I have "handled" them.
There is nothing in MSDN that says it requires any given return value or
passing up the chain.
> - At which point do you remove the subclassing of the window: before or
> after joyReleaseCapture() is called?
After releasing capture, normally when that window is closed.
Can anyone confirm that the process I have described actually works on
their PC rather then us chasing a real problem in windows?

Signature
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
iCode Systems
Dean Earley - 26 Aug 2008 17:29 GMT
>> Dean Earley <dean.earley@icode.co.uk> schrieb im Beitrag
>> <ut4UJq6AJHA.908@TK2MSFTNGP03.phx.gbl>...
[quoted text clipped - 25 lines]
> Can anyone confirm that the process I have described actually works on
> their PC rather then us chasing a real problem in windows?
As no one else can get this to work (or hasn't seen/tried) I can only
assume it is a bug in the Joystick API.
Oh well, good luck anyone else that tries it.

Signature
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
iCode Systems