
API Hot Key call in VB program to activate another resident program
Matt, that's exactly what I did. I discovered the solution last night and
it worked great. My final solution follows. Thanks for the tip.
-------------------
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Private Const VK_SHIFT = &H10
Private Const VK_CONTROL = &H11
Private Const KEYEVENTF_KEYUP = &H2
'
Private Sub mnuPrint_Click()
keybd_event VK_SHIFT, 0, 0, 0
keybd_event VK_CONTROL, 0, 0, 0
keybd_event Asc("S"), 0, 0, 0
keybd_event Asc("S"), 0, KEYEVENTF_KEYUP, 0
keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_SHIFT, 0, KEYEVENTF_KEYUP, 0
End Sub
Quote:
> Bryan,
> >Would anyone know the procedure to configure a
> >command button on a Visual Basic form to simulate this function?
> I'd try the keybd_event or SendInput APIs. I'm not sure it'll work,
> but it's worth a try.
> Matt
> ============================================
> CodeHound - Free VB Search Engine
> http://www.codehound.com