Results 1 to 9 of 9

Thread: Trying to get MSN Messenger Text

  1. #1

    Thread Starter
    Junior Member SkettaLEE's Avatar
    Join Date
    Oct 2001
    Location
    Shaw AFB, SC
    Posts
    30

    Trying to get MSN Messenger Text

    How can I get the Text that a user sent to me in MSN Messenger... I got the handle of Messenger but I cant get the text they sent out of it. Please Help!
    This is our world now, The world of the pop-trunk and the switch.
    The beauty of my Broad :-)
    We wage wars, murder, cheat, lie to our women and make them believe its for their own good. And we're the criminals.
    My crime is but of pimpology.
    I am a Pimp, and this is my manefesto!

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    If you already have the handle of the window then:

    VB Code:
    1. Public Declare Function SendMessage Lib "user32" _
    2. Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _
    3. Long, ByVal wParam As Long, lParam As Any) As Long
    4. Public Declare Function SendMessageByString Lib "user32" _
    5. Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _
    6. Long, ByVal wParam As Long, ByVal lParam As String) As Long
    7.  
    8. Public Const WM_GETTEXT = &HD
    9. Public Const WM_GETTEXTLENGTH = &HE
    10.  
    11. Public Function GetText(Window As Long) As String
    12. 'Gets any text from a window
    13. Dim Cursor As String, Text As Long
    14. Text& = SendMessage(Window&, WM_GETTEXTLENGTH, 0&, 0&)
    15. Cursor$ = String(Text&, 0&)
    16. Call SendMessageByString(Window&, WM_GETTEXT, Text& + 1, Cursor$)
    17. GetText$ = Cursor$
    18. End Function
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Junior Member SkettaLEE's Avatar
    Join Date
    Oct 2001
    Location
    Shaw AFB, SC
    Posts
    30

    its not working right.......

    this is the code im using.......

    TheNum = HScroll1.Value
    Instant% = lsthandle.List(TheNum)

    Win% = GetWindow(Instant%, GW_CHILD)

    Do
    Text2$ = GetClass(Win%)
    If Text2$ = "RichText20A" Then Exit Do
    Win% = GetWindow(Win%, GW_HWNDNEXT)
    Loop Until Win% = 0

    Text& = SendMessage(Win%, WM_GETTEXTLENGTH, 0&, 0&)
    Cursor$ = String(Text&, 0&)
    Call SendMessageByString(Win%, WM_GETTEXT, Text& + 1, Cursor$)
    Messages.Text = Cursor$



    I have my program look for all the instant messages and put them in a listbox. THen i fix it so that whichever one i want the text from i move the scroll bar to the number in the listbox and click get message and this is the get message command_click

    But it doesn't get any messages... it just sits there.... Messages.Text is a richtext box also....... can someone help me?
    This is our world now, The world of the pop-trunk and the switch.
    The beauty of my Broad :-)
    We wage wars, murder, cheat, lie to our women and make them believe its for their own good. And we're the criminals.
    My crime is but of pimpology.
    I am a Pimp, and this is my manefesto!

  4. #4
    Junior Member
    Join Date
    Oct 2001
    Location
    Unimatrix 0
    Posts
    17

    Red face

    Private Sub Msg_OnTextReceived(ByVal pIMSession As Messenger.IMsgrIMSession, _
    ByVal pSourceUser As Messenger.IMsgrUser, ByVal bstrMsgHeader As String, ByVal bstrMsgText As String, _
    pfEnableDefault As Boolean)

    'Do Stuff Here
    'bstrMsgText is the text received.

    End Sub
    Doctor UDP
    VB VBSCRIPT VC HTML JAVA COBOL RPG I II III needing to learn DirectX & .Net programming in VB.
    _____________________________
    The stupidest question is the one you didn't bother to ask.. ... . ... ... .

  5. #5
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    Originally posted by Doctor UDP
    Private Sub Msg_OnTextReceived(ByVal pIMSession As Messenger.IMsgrIMSession, _
    ByVal pSourceUser As Messenger.IMsgrUser, ByVal bstrMsgHeader As String, ByVal bstrMsgText As String, _
    pfEnableDefault As Boolean)

    'Do Stuff Here
    'bstrMsgText is the text received.

    End Sub
    Dont you need the reference to MSN object Library?
    You just proved that sig advertisements work.

  6. #6
    Junior Member
    Join Date
    Oct 2001
    Location
    Unimatrix 0
    Posts
    17

    Red face

    Well duhhhhh, yeah. Sorry somehow i assumed you had that already. Just goto Project > References and add Messenger Type Library and that should do it.
    Doctor UDP
    VB VBSCRIPT VC HTML JAVA COBOL RPG I II III needing to learn DirectX & .Net programming in VB.
    _____________________________
    The stupidest question is the one you didn't bother to ask.. ... . ... ... .

  7. #7
    Hyperactive Member BramVandenbon's Avatar
    Join Date
    Jan 2002
    Location
    Belgium
    Posts
    502
    is there anyway, to Set the text inside a windows instead of "get the text" ?
    ____________________________________________

    Please rate my messages. Thank you!
    ____________________________________________
    Bram Vandenbon
    http://www.bramvandenbon.com

  8. #8
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    This might give you a few ideas.
    Last edited by Nightwalker83; Dec 13th, 2007 at 07:45 PM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #9
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    "When Threads Arise From the Grave, Part 4"
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width