|
-
Feb 22nd, 2005, 09:33 PM
#1
Thread Starter
Admodistrator
Sendmessage help?
Since my other post seems to have gone off-topic, here we go:
I have used this code to find the IM window on trillian:
VB Code:
Option Explicit
'declare API:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Private Const My_Message As Long = 10001
Private Sub Form_Load()
'Class Name of the window:
Dim strClassName As String, lhWnd As Long, strclassname2 As String, lhWnd2 As Long
strClassName = "icoPMsgMSN"
strclassname2 = "icoPMsgAIM"
lhWnd = FindWindow(strClassName, vbNullString)
lhWnd2 = FindWindow(strclassname2, vbNullString)
'if the result is 0, window was not found:
'If lhWnd = 0 & lhWnd2 = 0 Then
' MsgBox "Could not find window..."
' Unload Form1
'Else
MsgBox "Window found: " & "MSN:" & lhWnd & "AIM:" & lhWnd2
' End If
i added SendMessage lhWnd, "Yo", 0&, 0&, <--to send the that window defined as lhwnd, that gives me an error as i assumed, but i need to find the textbox of the window im sending too with spy++, and i dont know what to look for, it gave me a page full of children..
My question is, how can i send a message to a textbox inside of an app, by its classname? the class name im looking for is: icoPMsgMSN <(which i do find)>
BTW im using trillian
thanks in advance
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
|