Re: Send message to a textbox:
aha!
ive found this code thru some searching:
CWnd* p = CWnd::FromHandle( (HWND) 0x00020326 );
p->SendMessage( WM_CHAR, (WPARAM)'d', 0 );
its c++ and they say that it will send one character at a time. can anyone convert to vb?
edit**this is a no go:
SendMessage hWndTextbox, WM_CHAR, 0&, ByVal CStr("h")
edit**
found this too:
VB Code:
main := FindWindowEx(0, 0, 'icoPMsgAIM', nil);
hStatus := FindWindowEx(main, 0, 'trillian display', nil);
hStatus := FindWindowEx(main, hStatus, 'trillian display', nil);
SetLength(s, 2048);
n := SendMessage(hStatus, WM_GETTEXT, 2048, Integer(@s[1]));
SetLength(s,n);
//s:=convert(s,'trillian',typ);
n := SendMessage(hStatus, WM_SETTEXT, length(s), Integer(@s[1]));
Re: Send message to a textbox:
Re: Send message to a textbox:
That's not C++, it doesnt look like quite what you want but heres my guess
VB Code:
Dim main As Long, hStatus As Long
main = FindWindowEx(0&, 0&, "icoPMsgAIM", vbNullString)
hStatus = FindWindowEx(main, 0&, "trillian display", vbNullString)
Dim s As String, n As Long
s = Space(2048)
n = SendMessage(hStatus, WM_GETTEXT, 2048, ByVal s)
s = Left$(s, n)
n = SendMessage(hStatus, WM_SETTEXT, Len(s), ByVal s)
Not sure how that would help.
Re: Send message to a textbox:
nope that didnt work either : /
Ive also found this code, to change the away message, could we do something with it?
Code:
if ((hwnd_trillian = FindWindow("trillian",NULL)) != NULL){
SendMessage(hwnd_trillian, WM_COMMAND, 40019, 0);
//MessageBox (hwnd_trillian, "message sent", "sent", MB_OK);
if ((hwnd_addmsg = FindWindow(NULL, "Add Away Message" )) != NULL){
//MessageBox (hwnd_trillian, "Add message window found", "success", MB_OK);
if ((hwnd_edit = FindWindowEx (hwnd_addmsg, NULL, "Edit", NULL)) != NULL){
SendMessage(hwnd_edit, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)"test1" );
if ((hwnd_edit = FindWindowEx (hwnd_addmsg, hwnd_edit, "Edit", NULL)) != NULL){
//MessageBox (hwnd_addmsg, "Edit found", "WOO", MB_OK);
SendMessage(hwnd_edit, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)"test" );
if ((hwnd_chk = FindWindowEx (hwnd_addmsg, NULL, "Button", "Save" )) != NULL){
//MessageBox (hwnd_trillian, "checkbox found unchecking...", "success", MB_OK);
SendMessage(hwnd_chk, BM_SETCHECK, BST_CHECKED, 0);
SendMessage(hwnd_chk, BM_CLICK, 0, 0);
if ((hwnd_btn = FindWindowEx (hwnd_addmsg, NULL, "Button", "I'm Away" )) != NULL){
//MessageBox (hwnd_trillian, "I'm away button found, clicking...", "success", MB_OK);
SendMessage(hwnd_btn, BM_CLICK, 0, 0);
}
}
}
}
}
}
Re: Send message to a textbox:
I googled and all I really found was a post of yours a while back somewhere else ;)
When I get home tonight I'll download Trillian and have a play around with it for ya :)
Re: Send message to a textbox:
VB Code:
Const BM_CLICK = &HF0F5&
Const BM_SETCHECK = &HF1&
Const BST_CHECKED = 1&
Const WM_COMMAND = &H111&
Dim hWndTrillian As Long
Dim hWndAddMsg As Long
Dim hWndEdit As Long
Dim hWndChk As Long
Dim hWndBtn As Long
hWndTrillian = FindWindow("trillian", vbNullString)
If (hWndTrillian) Then
SendMessage hWndTrillian, WM_COMMAND, 40019, ByVal 0&
hWndAddMsg = FindWindow(vbNullString, "Add Away Message")
If (hWndAddMsg) Then
hWndEdit = FindWindowEx(hWndAddMsg, 0&, "Edit", vbNullString)
SendMessage hWndEdit, WM_SETTEXT, 0, ByVal CStr("test1")
hWndEdit = FindWindowEx(hWndAddMsg, hWndEdit, "Edit", vbNullString)
If (hWndEdit) Then
SendMessage hWndEdit, WM_SETTEXT, 0, ByVal CStr("test")
hWndChk = FindWindowEx(hWndAddMsg, 0&, "Button", "Save")
If (hWndChk) Then
SendMessage hWndChk, BM_SETCHECK, BST_CHECKED, ByVal 0&
SendMessage hWndChk, BM_CLICK, 0, ByVal 0&
hWndBtn = FindWindowEx(hWndAddMsg, 0&, "Button", "I'm Away")
If (hWndBtn) Then
SendMessage hWndButton, BM_CLICK, 0, ByVal 0&
End If
End If
End If
End If
End If
Re: Send message to a textbox:
yup clancyber, that was really long ago. no one told helped me so i gave up until now : )
let me try that
Re: Send message to a textbox:
i couldnt get that to work either : /
Re: Send message to a textbox:
can anyone try and help me with this?
Re: Send message to a textbox:
Quote:
Originally Posted by |2eM!x
can anyone try and help me with this?
Please don't continue to bump this thread.