Click to See Complete Forum and Search --> : AppActivate & SendKeys
Skreen
Mar 21st, 2001, 01:09 PM
Are there any API equivalents to these VB methods?
Use the SetForegroundWindow and the SendMessage API functions.
Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" (ByVal hwnd As _
Long, ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Any) As Long
Private Declare Function SetForegroundWindow _
Lib "user32" (ByVal hwnd As Long) As Long
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
SetForegroundWindow hwnd
SendMessage hwnd, WM_SETTEXT, 0, ByVal "Text"
End Sub
Actually not. The WM_SETTEXT method differents from SendKeys. The SendKeys function is actually a series of WM_CHAR messages, but using WM_SETTEXT is easier.
Thanks for sharing Megatron.
So that's why the text comes out slowly like that?
H|
He|
Hel|
Hell|
Hello|
Hello |
Hello W|
Hello Wo|
Hello Wor|
Hello Worl|
Hello World|
Ah, so much free time :D.
Well, I haven't really noticed anything like that, but i'm not suprised if it does this.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.