-
Dec 2nd, 2003, 05:16 PM
#1
Thread Starter
Lively Member
Sending keystroke to a window
I have the window selected, and I have it pop that window up, but now how can I send the number 1 "1" keystroke to it.
Here is what I have so far to make the window pop up.
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const SW_SHOWNORMAL = 1
Const gcClassnamebow = "bow"
Private Sub Form_Load()
Dim WinWnd As Long, Ret As String
Ret = "bow"
WinWnd = FindWindow(vbNullString, Ret)
If WinWnd = 0 Then MsgBox "Couldn't find the bow Window": Exit Sub
ShowWindow WinWnd, SW_SHOWNORMAL
End Sub
It all works..just need to know how to send that keystroke.
-
Dec 2nd, 2003, 05:22 PM
#2
Hyperactive Member
it is very easy just use
send keys "1"
-
Dec 2nd, 2003, 05:25 PM
#3
Addicted Member
Ask around on the API Forum, maybe they can help ya out. But i think that's gonna be the way you're gonna have to go.
C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k
I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.
naked in vegas
-
Dec 2nd, 2003, 05:29 PM
#4
Thread Starter
Lively Member
Will do, and thanks.
BTW, sendkeys "1" works, however, once it sends the key, it minimizes back down to my app that I am manilupating the other with, is there a way I can prevent this?
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
|