SendInput Decleration 
Author Message
 SendInput Decleration

Hello all,

I am looking for a VB declaration for the SendInput function, the Input
structure and the MouseInput structure.  I'm having trouble with the
union in Input.  Any help would be appreciated.

Scott G. Brauer



Tue, 19 Feb 2002 03:00:00 GMT  
 SendInput Decleration
On Fri, 03 Sep 1999 09:45:30 -0600, "Scott G. Brauer"

Quote:

>Hello all,

>I am looking for a VB declaration for the SendInput function, the Input
>structure and the MouseInput structure.  I'm having trouble with the
>union in Input.  Any help would be appreciated.

Scott,

These declares should work. Note that the INPUT structure has been
split up in 3 different types because of the union. There are also 3
different declares for the SendInput function, aliased to a name to
fit the input type.

Private Type HARDWAREINPUT      ' 12 bytes
  uMsg As Long
  wParamL As Integer
  wParamH As Integer
  dwExtraInfo As Long
End Type

Private Type KEYBDINPUT         ' 16 bytes
  wVk As Integer
  wScan As Integer
  dwFlags As Long
  time As Long
  dwExtraInfo As Long
End Type

Private Type MOUSEINPUT         ' 24 bytes
  dx As Long
  dy As Long
  mouseData As Long
  dwFlags As Long
  time As Long
  dwExtraInfo As Long
End Type

Private Type INPUT_MOUSE
  type As Long
  mi As MOUSEINPUT
End Type

Private Type INPUT_KEYBD
  type As Long
  ki As KEYBDINPUT
  padding(1) As Long
End Type

Private Type INPUT_HARDWARE
  type As Long
  hi As HARDWAREINPUT
  padding(2) As Long
End Type

Private Declare Function SendInputMouse Lib "user32" Alias "SendInput"
(ByVal cInputs As Long, pInputs As INPUT_MOUSE, ByVal cbSize As Long)
As Long
Private Declare Function SendInputKeybd Lib "user32" Alias "SendInput"
(ByVal cInputs As Long, pInputs As INPUT_KEYBD, ByVal cbSize As Long)
As Long
Private Declare Function SendInputHardware Lib "user32" Alias
"SendInput" (ByVal cInputs As Long, pInputs As INPUT_HARDWARE, ByVal
cbSize As Long) As Long

Mattias

________________________________________________
Mattias "beezo" Sj?gren

http://home1.2.sbbs.se/mattias.sjogren/sw/



Tue, 19 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Global Class Decleration

2. SendInput Function in "user32.lib"

3. Type decleration

4. string decleration

5. sendinput

6. sendinput in unactive program

7. Sendkeys Slow - sendinput buggy

8. mapi decleration in vb4

9. Global Decleration - Problem.

10. SendInput and Unicode

11. sophisticated decleration

12. Decleration Problem - Urgent

 

 
Powered by phpBB® Forum Software