07-24-2011, 01:57 PM
Hey guys, im trying to make a external WoW addon, but i keep getting an error when im using the hwnd function.
Here's my code and i keep getting declare, findwindow, and SetFocusAPI underlined.
What am i doing wrong?
Here's my code and i keep getting declare, findwindow, and SetFocusAPI underlined.
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetFocusAPI Lib "user32.dll" Alias "SetFocus" (ByVal hWnd As Long) As Long
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hWnd As Long
hWnd = FindWindow(vbNullString, "World Of Warcraft")
SetFocusAPI(hWnd)
SendKeys.Send("{ENTER}")
SendKeys.Send("/run if(not scm) then scm = SendChatMessage; end; function SendChatMessage(msg, type, lang, chan) scm("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h" ..msg.."\124h\124r", type, lang, chan);end;")
End Sub
End Class
What am i doing wrong?