What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » hWnd of IMWindowClass chat input box

2 votes - 5 average   hWnd of IMWindowClass chat input box
Author: Message:
eSouL
Junior Member
**


Posts: 36
Joined: Oct 2005
O.P. RE: hWnd of IMWindowClass chat input box
I shifted the code out and tested it on a separate project, but it still doesn't work. Anything is wrong?

code:
Dim hwnd_msn As Long
Dim hwnd_msn_edit As Long
hwnd_msn = FindWindow("IMWindowClass", vbNullString)
hwnd_msn_edit = FindWindowEx(hwnd_msn, 0&, "DirectUIHWND", vbNullString)

Dim sText As String
sText = Text1.text
Text1.text = ""
   
For i = 1 To Len(sText)
  Call PostMessage(hwnd_msn_edit, WM_CHAR, Asc(Mid(sText, i, 1)), 0)
Next i
   
Call PostMessage(hwnd_msn_edit, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(hwnd_msn_edit, WM_KEYUP, VK_RETURN, 0&)



EDIT:
I realized that the above code will only work if I bring the window to the front first using this code:
code:
   
    Dim RetVal As Long
    RetVal = SetForegroundWindow(hwnd_msn_edit)
    WaitForSingleObject RetVal, INFINITE


It wasn't very reliable though. Some messages would not get sent. Some concatenated and got sent as one line. (Tested it by repeatedly sending string of messsages through a text box)

Funny thing is, posting messages to Notepad actually works without having to bring the window to the front. I wonder why the difference. *-)

This post was edited on 10-12-2005 at 05:32 AM by eSouL.
10-12-2005 05:13 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
hWnd of IMWindowClass chat input box - by eSouL on 10-10-2005 at 03:32 PM
RE: hWnd of IMWindowClass chat input box - by J-Thread on 10-10-2005 at 04:19 PM
RE: hWnd of IMWindowClass chat input box - by matty on 10-10-2005 at 04:28 PM
RE: hWnd of IMWindowClass chat input box - by eSouL on 10-10-2005 at 04:39 PM
RE: hWnd of IMWindowClass chat input box - by Stigmata on 10-10-2005 at 04:57 PM
RE: hWnd of IMWindowClass chat input box - by J-Thread on 10-10-2005 at 04:58 PM
RE: hWnd of IMWindowClass chat input box - by matty on 10-10-2005 at 05:11 PM
RE: hWnd of IMWindowClass chat input box - by Mike on 10-10-2005 at 05:14 PM
RE: hWnd of IMWindowClass chat input box - by matty on 10-10-2005 at 05:17 PM
RE: hWnd of IMWindowClass chat input box - by Plik on 10-10-2005 at 05:36 PM
RE: hWnd of IMWindowClass chat input box - by eSouL on 10-10-2005 at 06:09 PM
RE: hWnd of IMWindowClass chat input box - by matty on 10-10-2005 at 06:50 PM
RE: hWnd of IMWindowClass chat input box - by eSouL on 10-10-2005 at 07:03 PM
RE: hWnd of IMWindowClass chat input box - by matty on 10-10-2005 at 08:23 PM
RE: hWnd of IMWindowClass chat input box - by eSouL on 10-11-2005 at 03:47 AM
RE: hWnd of IMWindowClass chat input box - by matty on 10-11-2005 at 03:55 AM
RE: hWnd of IMWindowClass chat input box - by eSouL on 10-12-2005 at 05:13 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On