کد:
'//Programmer Mohammad Amin Mansouri
'//'Forum : www.PariCoders.com
'// Send To All (Chat Room And Private Pm) Test Mirc 6.35
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Const WM_SETTEXT = &HC
Private Const WM_KEYDOWN = &H100
Private Const VK_RETURN = &HD
Private Const WM_CHAR = &H102
Private Declare Function SendMessageBynum Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Function AminSendTextMirc(PmText As String)
Dim Handle1, Handle2, Handle3, Handle4, Handle5, Handle6 As Long
Handle1 = FindWindow("mIRC", vbNullString)
Handle2 = FindWindowEx(Handle1, 0, "mdiclient", vbNullString)
Handle3 = FindWindowEx(Handle2, 0, "mIRC_Channel", vbNullString)
Handle4 = FindWindowEx(Handle3, 0, "Edit", vbNullString)
Handle5 = FindWindowEx(Handle2, 0, "mIRC_Query", vbNullString)
Handle6 = FindWindowEx(Handle5, 0, "Edit", vbNullString)
SendMessageByString Handle4, WM_SETTEXT, 0, (PmText)
SendMessageByString Handle6, WM_SETTEXT, 0, (PmText)
Call SendMessageBynum(Handle4, WM_CHAR, 13, ByVal 0)
Call SendMessageBynum(Handle6, WM_CHAR, 13, ByVal 0)
End Function
Private Sub Form_Load()
Call AminSendTextMirc("Www.ParsiCoders.Com Sta By Parsa ;-)")
End Sub