New topic: 

Mouse Events Hook in Windows 32

<http://forums.realsoftware.com/viewtopic.php?t=37053>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        sweetname          Post subject: Mouse Events Hook in Windows 
32Posted: Wed Jan 12, 2011 6:39 pm                         
Joined: Wed Sep 16, 2009 4:52 pm
Posts: 6                Hello.

I'm trying to figure out how to write REALbasic code that taps into the native 
windows api to return mouse messages for all applications.  I understand that 
this involves the mouseproc callback function and creating a .dll file, but as 
far as what explicitly to write I'm lost in all the lparam, ncode, hwnd, etc. 
madness.

Can anyone help me out with example code or perhaps link me to a project that 
already uses this type of approach at monitoring mouse input?  Keyboard input 
would also be helpful.  Either way, I'll be able to understand one from the 
implementation of the other.  Basically, I'm trying to put together a module to 
do keylogging so that I can more easily write custom event definitions for 
controls.  Like a "right-button drag" event, for example.

Thanks in advance, I really appreciate it!   
                             Top                 timhare          Post subject: 
Re: Mouse Events Hook in Windows 32Posted: Wed Jan 12, 2011 6:47 pm             
            
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 8895
Location: Portland, OR  USA                You need to "subclass" the window in 
the Win32 sense.  There is an example of this in the Windows Functionality 
Suite.  It involves registering your own winproc routine using the Win32 API, 
and then passing forward any messages you don't handle.  Fortunately, creating 
a .dll file has nothing to do with it.  Not sure where you got that idea.

If you're not already comfortable with Win32 programming, including the lparam 
madness, be VERY careful.  I was completely lost in all that until I studied 
the Win32 side of it.  Then it made perfect sense.  Read the first chapter or 
two of just about any Win32 programming book, and you'll have enough to go on.  
 
                             Top                sweetname          Post 
subject: Re: Mouse Events Hook in Windows 32Posted: Wed Jan 12, 2011 6:51 pm    
                     
Joined: Wed Sep 16, 2009 4:52 pm
Posts: 6                @timhare

I'll have a look at that example, thank you.  But I was under the impression 
that to get mouse messages for all running applications that one had to create 
some sort of dynamic link library to handle it on a global level, as opposed to 
only receiving messages for the application/thread that created the mouseproc 
call.

EDIT:

It appears as though I'd have to pay to have a look at the source code for the 
Windows Functionality Suite and, unfortunately, I'm way too poor to do anything 
of the sort right now.   
                             Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to