Click here to Skip to main content
16,006,845 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
maszup2-Apr-08 5:05
maszup2-Apr-08 5:05 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
Randor 2-Apr-08 5:10
professional Randor 2-Apr-08 5:10 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
maszup2-Apr-08 5:33
maszup2-Apr-08 5:33 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
Randor 2-Apr-08 6:31
professional Randor 2-Apr-08 6:31 
AnswerRe: Hooking Raw Input - Detect HID mice Pin
maszup2-Apr-08 9:27
maszup2-Apr-08 9:27 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
maszup7-Apr-08 21:56
maszup7-Apr-08 21:56 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
Randor 12-Apr-08 20:30
professional Randor 12-Apr-08 20:30 
GeneralRe: Hooking Raw Input - Detect HID mice Pin
Dave Kreskowiak2-Apr-08 6:48
mveDave Kreskowiak2-Apr-08 6:48 
Hmmm... Didn't know about the RAWxxx structures. It looks kind of promising, though you'd have to make constant use of the GetRawInputDeviceInfo function to get the name and device information for each mouse message. I can see this turning into a large problem very quickly.


maszup wrote:
But if i focus on other window it stops receiving notifications.


True. The RegisterRawInputDevices function will only work on the thread that called it, aka, your application. It will not intercept messages going to other processes (other threads) since each process (in user mode) thinks it's the only process running in the system. When the input focus is moved to a different application window, those WM_INPUT messages only go to that window. They don't propogate system-wide.

The only way to see mouse messages system-wide is to implement a MouseProc and use the Windows Hooks functions (SetWindowsHook). But, in doing so, you also lose the ability to get the Raw Input data since raw isn't supported by the hook messages.

maszup wrote:
Maybe it is possible to use HIDd_GetFeature and reports to read mouse position?


Mice don't have a position. The cursor on the screen has position. Mice just say how far and in what direction the mouse moved since the last movement report.

I'm with Randor on this one. It looks like the only possible way to get this to work would be a filter driver.



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




QuestionBuilding c# pc remote control? Pin
Goalie3531-Mar-08 17:22
Goalie3531-Mar-08 17:22 
AnswerRe: Building c# pc remote control? Pin
Matthew Butler2-Apr-08 14:56
Matthew Butler2-Apr-08 14:56 
GeneralRe: Building c# pc remote control? Pin
Goalie352-Apr-08 19:11
Goalie352-Apr-08 19:11 
GeneralRe: Building c# pc remote control? Pin
Matthew Butler3-Apr-08 2:57
Matthew Butler3-Apr-08 2:57 
GeneralMonitor blur Pin
Mekong River31-Mar-08 17:19
Mekong River31-Mar-08 17:19 
GeneralRe: Monitor blur Pin
Sebastian Schneider2-Apr-08 5:00
Sebastian Schneider2-Apr-08 5:00 
GeneralRe: Monitor blur Pin
Mekong River3-Apr-08 0:11
Mekong River3-Apr-08 0:11 
GeneralRe: Monitor blur Pin
Dave Kreskowiak3-Apr-08 3:47
mveDave Kreskowiak3-Apr-08 3:47 
General_asm code Pin
ForNow31-Mar-08 14:33
ForNow31-Mar-08 14:33 
GeneralUsing and Preserving Registers in Inline Assembly Pin
Randor 1-Apr-08 16:42
professional Randor 1-Apr-08 16:42 
GeneralRe: Using and Preserving Registers in Inline Assembly Pin
ForNow1-Apr-08 19:41
ForNow1-Apr-08 19:41 
GeneralAnything special prlouge __fastcall with _asm Pin
ForNow3-Apr-08 6:16
ForNow3-Apr-08 6:16 
GeneralRe: Anything special prlouge __fastcall with _asm Pin
Randor 7-Apr-08 17:37
professional Randor 7-Apr-08 17:37 
GeneralRe: Anything special prlouge __fastcall with _asm Pin
ForNow7-Apr-08 23:03
ForNow7-Apr-08 23:03 
GeneralRe: Using and Preserving Registers in Inline Assembly Pin
bob169726-Apr-08 7:39
bob169726-Apr-08 7:39 
GeneralRe: Using and Preserving Registers in Inline Assembly Pin
Randor 7-Apr-08 17:58
professional Randor 7-Apr-08 17:58 
GeneralRe: Using and Preserving Registers in Inline Assembly Pin
bob169728-Apr-08 3:29
bob169728-Apr-08 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.