How do I capture mouse and keyboard events? 
Author Message
 How do I capture mouse and keyboard events?

I want to write a specilized Windows macro recorder. I need an API function
or control that will signal my program whenver a mouse event occurs (along
with the coordinates), and when keyboard events occur(along with the key
number) anywhere on the screen.  Is there an API function, or control for
this purpose?


Sat, 21 Jun 2003 08:02:34 GMT  
 How do I capture mouse and keyboard events?
You need to use the SetWindowsHookEx API. But as you want the hook to be
 system wide, you have to place the callback routine in a DLL, and as you
probably know, you cant make dlls in VB.. You will need to make a dll in C++
or Delphi or something like that. But im sure you will find some dll on the
net...



Quote:
> I want to write a specilized Windows macro recorder. I need an API
function
> or control that will signal my program whenver a mouse event occurs (along
> with the coordinates), and when keyboard events occur(along with the key
> number) anywhere on the screen.  Is there an API function, or control for
> this purpose?



Sat, 21 Jun 2003 21:12:25 GMT  
 How do I capture mouse and keyboard events?
If you use VB5, you can make a dll.
Quote:

>You need to use the SetWindowsHookEx API. But as you want the hook to be
> system wide, you have to place the callback routine in a DLL, and as you
>probably know, you cant make dlls in VB.. You will need to make a dll in C++
>or Delphi or something like that. But im sure you will find some dll on the
>net...



>> I want to write a specilized Windows macro recorder. I need an API
>function
>> or control that will signal my program whenver a mouse event occurs (along
>> with the coordinates), and when keyboard events occur(along with the key
>> number) anywhere on the screen.  Is there an API function, or control for
>> this purpose?



Sun, 22 Jun 2003 07:02:39 GMT  
 How do I capture mouse and keyboard events?
1. Can you explain why I have to use a DLL?
2. What do I use for the hWnd when I call SetWindowsHookEx? The hWnd for the
desktop?


Quote:
> You need to use the SetWindowsHookEx API. But as you want the hook to be
>  system wide, you have to place the callback routine in a DLL, and as you
> probably know, you cant make dlls in VB.. You will need to make a dll in
C++
> or Delphi or something like that. But im sure you will find some dll on
the
> net...



> > I want to write a specilized Windows macro recorder. I need an API
> function
> > or control that will signal my program whenver a mouse event occurs
(along
> > with the coordinates), and when keyboard events occur(along with the key
> > number) anywhere on the screen.  Is there an API function, or control
for
> > this purpose?



Mon, 23 Jun 2003 12:04:22 GMT  
 How do I capture mouse and keyboard events?
1. The Win32API Reference Help File says like this:

The system hooks are a shared resource, and installing one affects all
applications. All system hook functions must be in libraries. System hooks
should be restricted to special-purpose applications or to use as a
development aid during application debugging.

2. There is no hWnd param for SetWindowsHookEx... Declare for
SetWindowsHookEx:

Public Declare Function SetWindowsHookEx Lib "user32" Alias
"SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As
Long, ByVal dwThreadId As Long) As Long

There is no hWnd param...



Quote:
> 1. Can you explain why I have to use a DLL?
> 2. What do I use for the hWnd when I call SetWindowsHookEx? The hWnd for
the
> desktop?



> > You need to use the SetWindowsHookEx API. But as you want the hook to be
> >  system wide, you have to place the callback routine in a DLL, and as
you
> > probably know, you cant make dlls in VB.. You will need to make a dll in
> C++
> > or Delphi or something like that. But im sure you will find some dll on
> the
> > net...



> > > I want to write a specilized Windows macro recorder. I need an API
> > function
> > > or control that will signal my program whenver a mouse event occurs
> (along
> > > with the coordinates), and when keyboard events occur(along with the
key
> > > number) anywhere on the screen.  Is there an API function, or control
> for
> > > this purpose?



Mon, 23 Jun 2003 19:22:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Capturing Mouse & Keyboard Events Anywhere in Application

2. Capturing Mouse & Keyboard Events Anywhere in Application

3. Capturing Mouse/Keyboard Events at the Application Level

4. Capturing Mouse & Keyboard Events Anywhere in Application

5. capturing mouse and keyboard events

6. How can I capture keyboard and mouse inputs

7. capture keyboard events without interfering with apps

8. Capturing Keyboard Event

9. Capture desktop keyboard events?

10. capture all keyboard events

11. Capture Keyboard Event

12. Mouse Click and Keyboard Event

 

 
Powered by phpBB® Forum Software