by Christopher Priestland (2 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 4th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This Sends A Message To People On Msn Messenger(which ewver window is open) this code is very simple one line of code.
Public Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public 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
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Public 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
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Public 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
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const BM_SETCHECK = &HF1
Public Const BM_GETCHECK = &HF0
Public Const CB_GETCOUNT = &H146
Public Const CB_GETLBTEXT = &H148
Public Const CB_SETCURSEL = &H14E
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDNEXT = 2
Public Const GW_CHILD = 5
Public Const LB_GETCOUNT = &H18B
Public Const LB_GETTEXT = &H189
Public Const LB_SETCURSEL = &H186
Public Const SW_HIDE = 0
Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_NORMAL = 1
Public Const SW_SHOW = 5
Public Const VK_SPACE = &H20
Public Const WM_CHAR = &H102
Public Const WM_CLOSE = &H10
Public Const WM_COMMAND = &H111
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_MOVE = &HF012
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_SETTEXT = &HC
Public Const WM_SYSCOMMAND = &H112
Public Sub SendMessage(thetext As String)
Dim imwindowclass As Long, richedita As Long
imwindowclass = FindWindow("imwindowclass", vbNullString)
richedita = FindWindowEx(imwindowclass, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(imwindowclass, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, thetext)
Call clicksend
End Sub
Public Sub clicksend()
Dim imwindowclass As Long, button As Long
imwindowclass = FindWindow("imwindowclass", vbNullString)
button = FindWindowEx(imwindowclass, 0&, "button", vbNullString)
Call SendMessageLong(button, WM_KEYDOWN, VK_SPACE, 0&)
Call SendMessageLong(button, WM_KEYUP, VK_SPACE, 0&)
End Sub
'the code
Call SendMessage("Your Greeting Here")
'thats it simple huh?
No comments have been posted about This Sends A Message To People On Msn Messenger(which ewver window is open) this code is very simpl. Why not be the first to post a comment about This Sends A Message To People On Msn Messenger(which ewver window is open) this code is very simpl.