Frage:
Kann man irgendwie den Mousewheeldelta abfragen, während das Program keinen Focus hat?
Ich hab jetzt mal mit Mousehooks experimentiert, und genauso wie bei callbacks etc. bekommt man von der WinAPI ja die eventswparam(), da steht #wm_Mousewheel drinnen. Also ob oder ob kein mousewheel event anliegt. Eigentlich sollte dann ja im nächsten wparams das Mausdelte drin stehen.
Hier mal was ich meine:
Code: Alles auswählen
hwnd = OpenWindow(#PB_Any,0,0,100,100,"")
SetFocus_(hwnd)
Repeat
event = WaitWindowEvent(1)
If event = #WM_MOUSEWHEEL
Debug EventwParam()
EndIf
ForEver
Zweiter Codeschnipsel geht genauso wenig:
Code: Alles auswählen
Structure MSLLHOOKSTRUCT
pt.POINT;
mouseData.l;
flags.l;
time.l;
dwExtraInfo.l;
EndStructure
Procedure.l MouseProc(ncode.l,wParam.l,lParam.l)
Static lbStarttime.i,lbEndtime.i
Static rbStarttime.i,rbEndtime.i
Static sx,ex,sy,ey
Protected px,py
Static mMouseInput.MSLLHOOKSTRUCT
CopyMemory(lparam,@mMouseInput,SizeOf(MSLLHOOKSTRUCT))
Static mInput.MOUSEINPUT
lastevent = event
If ncode = #HC_ACTION
If wParam
Select wParam
Case #WM_MOUSEWHEEL
Debug "DELTA?"
EndSelect
EndIf
EndIf
ProcedureReturn CallNextHookEx_(myMousehook, nCode, wParam, lParam)
EndProcedure
Procedure SetMouseHook()
hInstance = GetModuleHandle_(0)
If hInstance
myMouseHook = SetWindowsHookEx_(#WH_MOUSE_LL, @MouseProc(),hInstance,0)
Else
MessageRequester("hook", "can't get module handle")
EndIf
EndProcedure
SetMouseHook()
Repeat
Delay(1)
ForEver