Results 1 to 2 of 2

Thread: i have prolems sendmessage

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    7

    i have prolems sendmessage

    sometime my sendmessage to diablo 2 works but sometime dont here my code



    -------------------------------------

    Public Sub D2ChatSend(lpWindowName As String, strString As String)
    Dim c$, i&, w&
    w& = FindWindow(vbNullString, lpWindowName$)

    If w& = 0 Then MsgBox "Window not found!", vbCritical, "Error!"
    For i& = 1 To Len(strString$)
    c$ = Mid$(strString$, i, 1)

    Call SendMessage(w&, WM_CHAR, Asc(c$), 0&)
    Call SendMessage(w&, WM_KEYDOWN, Asc(c$), 0&)


    Next i
    End Sub
    -----------------------------------------------------

  2. #2
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Set the focus to the Diablo2 chat textbox first. You can do this by sending a message that presses the left mouse button down, then up to the correct X and Y coordinates. If you still have problems, post back.

    Code:
    SendMessageLong hWnd&, WM_LBUTTONDOWN, X, Y
    SendMessageLong hWnd&, WM_LBUTTONUP, X, Y
    Use SendMessageLong instead.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

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