Results 1 to 3 of 3

Thread: Odd Code Problem

  1. #1

    Thread Starter
    Addicted Member macuiare's Avatar
    Join Date
    Jan 2009
    Posts
    229

    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

  2. #2
    Addicted Member
    Join Date
    Oct 2009
    Posts
    212

    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.
    Have you tried Google?

  3. #3

    Thread Starter
    Addicted Member macuiare's Avatar
    Join Date
    Jan 2009
    Posts
    229

    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
  •  



Click Here to Expand Forum to Full Width