|
-
Oct 24th, 2001, 12:00 PM
#1
Thread Starter
New Member
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
-----------------------------------------------------
-
Oct 27th, 2001, 09:54 AM
#2
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|