|
-
Nov 6th, 2009, 04:21 PM
#1
Thread Starter
Addicted Member
Odd Code Problem
Hey I have another problem alot like
http://www.vbforums.com/showthread.p...=1#post3650448
which was posted yesterday, the code was replacing my fail way of replacing textbox text but now in the same place in dolisten i cant use sendkeys.send
so i tried fixing it myself with
Code:
Private Sub Sendtext(ByVal text As String)
SendKeys.Send(text)
End Sub
but that didnt work either, could anyone show me a way to do sendkeys the "pro" way I would appreciate it alot
To be clear, Im not using sendkeys to update a textbox, but to actually send keys the client sends text to the server and the server will type it out basicly.
but it doesnt seem to work with the same problems in the link i attached above
Thanks
-
Nov 6th, 2009, 07:55 PM
#2
Addicted Member
Re: Odd Code Problem
I looked at this a while back, and it seems pros pretty much hate SendKeys. I've personally seen it get really ugly. At best it seems unreliable, at worst downright dangerous. http://www.vbforums.com/showthread.php?t=354120 Perhaps others know best, but it seems the "sendmessage" api is the "pro" way. There's an example at the end of that post that should work, or at least point you in the right direction.
-
Nov 6th, 2009, 10:02 PM
#3
Thread Starter
Addicted Member
Re: Odd Code Problem
Just what i needed thankyou 
How do I get it to send a string though
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Const KEYEVENTF_KEYUP As Long = &H2
and what for sending so far i have
Call SendMessage(HWND_BROADCAST, Text)
but it doesnt work
thankyou
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
|