|
-
October 31st, 1999, 04:57 PM
#1
how can i send keys
how can i send keys from my application to any other programe that i make active by mouse clicking. or i have to use the z-order method to find second active programe?
-
November 1st, 1999, 05:39 PM
#2
Re: how can i send keys
Use SendKeys (Check the online help for details), it's very easy to use. Unfortunatly I don't have sample-projects at this time, sorry.
-
November 2nd, 1999, 03:42 PM
#3
Re: how can i send keys
This is an example with Windows Dialer (some of elements are not shown):
private Sub Dial()
'FindWindow and SetWindowPos& are API finctions declared as public in a module
Dim lngReturnValue as Long
lngReturnValue = FindWindow("DialerClass", vbNullString)
'make Dialer the most top form
lngReturnValue = SetWindowPos&(lngReturnValue, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)
'create DialNumber depending on area code. Variable intListIndex is used to determine which lstAccountPhone is highlighted
If Left(lstAccountPhone(intListIndex).Text, 7) <> " (" & strAreaCode & ")" then 'check whether the area code is a local
DialNumber = "1" & lstAccountPhone(intListIndex).Text 'add 1 and use full entry from the field PhoneNumber
else
DialNumber = Right(lstAccountPhone(intListIndex).Text, 8) ' if area code is local, use only last 7 digits (plus one dash) from the phoneNumber
End If
'there are List Boxes on the form, but for testing you can set DialNumber variable directly, for example DialNumber = "718-743-1210"
SendKeys DialNumber, true
SendKeys "{Enter}", true
End Sub
HTH
Vlad
-
November 5th, 1999, 03:12 PM
#4
Re: how can i send keys
thanks, but the problem is that how can i make the last active window active from my programe. for example
i am using note pade, then i started my programe, now active window is my programe, i press a button in my programe, and the keys
r send to notepade
-
November 5th, 1999, 03:20 PM
#5
Re: how can i send keys
thanks, but the problem is that how can i make the last active window active from my programe. for example
i am using note pad, then i started my programe, now active window is my programe, i press a button in my programe, and the
keys r send to notepad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|