Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

_WinAPI_RegisterRawInputDevices

$
0
0

Hello
I need help about _WinAPI_RegisterRawInputDevices (from WinAPIEx.au3)
The helpfile for this func says

_WinAPI_RegisterRawInputDevices ( $pDevice [, $iCount] ) $pDevice = "A pointer to an array of $tagRAWINPUTDEVICE structures"   $iCount = "The number of entries in the array"

If I register mouse and keyboard separately, it works :

$tRID_M = DllStructCreate($tagRAWINPUTDEVICE) DllStructSetData($tRID_M, 'UsagePage', 0x01) ; Generic Desktop Controls DllStructSetData($tRID_M, 'Usage', 0x02) ; Mouse DllStructSetData($tRID_M, 'Flags', $RIDEV_INPUTSINK) DllStructSetData($tRID_M, 'hTarget', $hForm) $pRID_M = DllStructGetPtr($tRID_M) $tRID_KD = DllStructCreate($tagRAWINPUTDEVICE) DllStructSetData($tRID_KD, 'usUsagePage', 0x01) DllStructSetData($tRID_KD, 'usUsage', 0x06) ; Keyboard DllStructSetData($tRID_KD, 'dwFlags', $RIDEV_INPUTSINK) DllStructSetData($tRID_KD, 'hwndTarget', $hGUI) $pRID_KD = DllStructGetPtr($tRID_KD) ; Register HID input to obtain row input from keyboard _WinAPI_RegisterRawInputDevices($pRID_KD) ; Register HID input to obtain row input from mouse _WinAPI_RegisterRawInputDevices($pRID_M)

But I can't get to register them together (using $iCount = 2) , as this MS example does :

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645546%28v=vs.85%29.aspx#example_2

So can you please tell me how to translate this code to autoit to make this 'array of structures' ? I tried several ways but none worked

Thanks
 

 

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>