Shoutbox

oConversationWnd - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: oConversationWnd (/showthread.php?tid=50922)

oConversationWnd by dazlee on 09-25-2005 at 06:05 PM

Hey, im working on a shared browser, so i got me a /goto command and a form with my browser....

my problem ='s this, how can i get something unique for that convisation like a session ID? etc so i can open multiple browser windows for multiple conv's

Also how can i send a msg to a convisation? not in reply to a parse command but on the fly, say if i had a session ID or oConversationWnd object.... ?

Thanks!!!!!!!!!!!!!!!!! ive been strugling all day :(

Daz


RE: oConversationWnd by Stigmata on 09-25-2005 at 06:08 PM

the hwnd is individual


RE: oConversationWnd by dazlee on 09-25-2005 at 06:09 PM

Ah yes, i forgot about that

But what about sending a msg to it if i have hwnd?


RE: oConversationWnd by Stigmata on 09-25-2005 at 06:17 PM

code:
SendMessage(hwnd, SOME_RANDOM_FLAG, Message, Other Message)


RE: oConversationWnd by dazlee on 09-25-2005 at 06:33 PM

i meant a chat msg not wmsg


RE: oConversationWnd by Plik on 09-25-2005 at 06:42 PM

quote:
Originally posted by dazlee
Ah yes, i forgot about that

But what about sending a msg to it if i have hwnd?

You can use a sendkeys type things to "type" the text and the press enter.
A better method is using PostMessage to mimic the messages sent when the user types, as this doesnt require the convosation window to have focus.
RE: oConversationWnd by dazlee on 09-25-2005 at 06:48 PM

but wont it require the text field to be focused?


RE: oConversationWnd by Plik on 09-25-2005 at 07:03 PM

quote:
Originally posted by dazlee
but wont it require the text field to be focused?
Not if you use postmessage to send fake keystroke messages to the window.
RE: oConversationWnd by dazlee on 09-25-2005 at 07:34 PM

Hey again, i tried what you said but i cant get it to work:

Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long


Private Sub sendKey(ByVal key As Long)
    PostMessage win, &H100, key, 0
End Sub


sendKey Asc("h")

I know the win var is correct coz i tried a destoryWindow ... any idea?


RE: oConversationWnd by TheGeek on 09-26-2005 at 07:25 PM

here's something i think can help you:

code:
void SendTextToNotepad(char *theString){
    HWND hNotepad = FindWindow("Notepad", NULL);
    if(hNotepad){
        HWND hEditBox = GetDlgItem(hNotepad, 15);
        for(int i = 0; i < strlen(theString); i++){
            PostMessage(hEditBox, WM_CHAR, (WPARAM)theString[i], 0);
        }
    }
}
It's c++, but i think you'll manage to translate it to vb...
It sends a string to notepad...
RE: oConversationWnd by dazlee on 09-27-2005 at 04:45 PM

i translated it, getDLGItem for IMWindow or the child DirectUIHWND returns 0

i can get it working in a seperate app put in the dll i cant get the focusing of msn to work.

I use:

Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long

And i loop until its focused, however it freezes coz inside the dll it wont bring it forward but same code in my other app will, exactally the same hwnd's????

any ideas????


RE: oConversationWnd by matty on 10-05-2005 at 03:18 PM

quote:
Originally posted by dazlee
i translated it, getDLGItem for IMWindow or the child DirectUIHWND returns 0

i can get it working in a seperate app put in the dll i cant get the focusing of msn to work.

I use:

Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long

And i loop until its focused, however it freezes coz inside the dll it wont bring it forward but same code in my other app will, exactally the same hwnd's????

any ideas????


Declare the Const Infinite and use WaitForSingleObject

retval=SetForegroundwindow()
waitforsingleobject retval,infinite

hopfully this will work