Advertisement
4_2005-2006 Miscellaneous #158802

Broadcast Over MSN

This code will Send a message to all open MSN Conversation Windows. Please comment and vote!

AI

สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ซอร์สโค้ด
original-source
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
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
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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
Const XP = "RichEdit20W"
Const Win98 = "RichEdit20A"
'If you cant Get it to work useing these two, then get an API Spyer
'and click on the IM's chat box then replace that value with that one
Sub SendText(Text As String)
Dim IMWindow, RichTB, RichTB2, SendButton As Long
IMWindow = FindWindow("IMWindowClass", vbNullString) 'Get IM's Hwnd
If IMWindow = 0 Then Exit Sub 'if no Im's open then exit
RichTB = FindWindowEx(IMWindow, 0, XP, vbNullString) ' Get Chat Rooms Hwnd
RichTB2 = FindWindowEx(IMWindow, RichTB, XP, vbNullString) 'Get Chat Box Hwnd
SendButton = FindWindowEx(IMWindow, 0, "Button", "&Send") 'Get Send Button Hwnd
SendMessageByString RichTB2, &HC, 0, Text 'Get Send Buttons Hwnd
Call SendMessage(SendButton, &H100, &H20, 0&) 'Click the Button
Call SendMessage(SendButton&, &H101, &H20, 0&)
End Sub
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine