Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendKey Question

Status
Not open for further replies.

M626

Programmer
Joined
Mar 13, 2002
Messages
299
I am using sendkey to work with another program... but it won't wirte to the application even though I do have the app active. Can someone tell me if there is another way to do sendkey? here is what i have tried:

SendKeys "{ENTER}", (1)
SendKeys (vbTab)
 
No that didn't work.
 
Try this

Option Explicit

Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_TAB = &H9
Private Const VK_RETURN = &HD

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)

Private Sub cmdEnterTab_Click()

'Code here to set the focus to where you want the keys sent

keybd_event VK_RETURN, 0, 0, 0
keybd_event VK_RETURN, 0, KEYEVENTF_KEYUP, 0
DoEvents
keybd_event VK_TAB, 0, 0, 0
keybd_event VK_TAB, 0, KEYEVENTF_KEYUP, 0
End Sub
If you choose to battle wits with the witless be prepared to lose.
[machinegun][ducky]
 
This still doesn't send the keys to the Citrix app...
I did see that citrix does provide a "Wfica.ocx" file
...I never used ocx files but Can I use that to send
tabs,enter and paste to the Citrix App...
 
is there a way to do a sendkeys without activating the app? (ie without flipping back and forth between your VB and app windows?)
 
I tried to do it without making it active but it didn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top