What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Button in chat window

Button in chat window
Author: Message:
posseke
New Member
*


Posts: 14
41 / Male / –
Joined: Nov 2005
O.P. RE: Button in chat window
Hi, I'm here with the last error I think will come up:

Everything goes well, the setParent works, but i can't see the button I just added to the IM window.

When looking closer, I see there is an error while processing
the 'GetWindowRect(pIMWindow.hwnd, R)' statement(at bottom of code sample).
What am I doing wrong?? please, this is probably my last error, so I appreciate your help!

code:
Imports MessengerAPI
Public Class FragMsnIMButton

    Private WithEvents oMessenger As Messenger
    Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
    Public Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, ByVal lpRect As RECT) As Long

    Public Structure RECT
        Dim x As Long
        Dim y As Long
        Dim Width As Long
        Dim Height As Long
    End Structure

    Public R As RECT
    Public newBtn As Object

    Private Sub FragMsnIMButton_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        oMessenger = New Messenger
    End Sub

    Private Sub oMessenger_OnIMWindowCreated(ByVal pIMWindow As Object) Handles oMessenger.OnIMWindowCreated
        '
        Try
            newBtn = New FragMsnIMButton ' create a copy of FragMsnIMButton
            Dim child As System.IntPtr = newBtn.btnFrag.Handle.ToString
            Dim par As System.IntPtr = pIMWindow.hwnd.ToString
            '
            SetParent(child, par)
            '
            Try
                GetWindowRect(pIMWindow.hwnd, R)
            Catch ex As Exception
                MsgBox(ex.Message.ToString)
            End Try
            '
            newBtn.btnFrag.left = 13500 'Moving the textbox under the display picture
            newBtn.btnFrag.right = 2800
        Catch ex As Exception
            MsgBox(ex.Message.ToString)
        End Try

    End Sub

End Class

11-29-2005 11:36 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Button in chat window - by posseke on 11-29-2005 at 09:39 AM
RE: Button in chat window - by RaceProUK on 11-29-2005 at 01:02 PM
RE: Button in chat window - by posseke on 11-29-2005 at 01:26 PM
RE: Button in chat window - by matty on 11-29-2005 at 02:24 PM
RE: Button in chat window - by posseke on 11-29-2005 at 05:25 PM
RE: Button in chat window - by Stigmata on 11-29-2005 at 05:51 PM
RE: Button in chat window - by posseke on 11-29-2005 at 07:24 PM
RE: Button in chat window - by Stigmata on 11-29-2005 at 07:28 PM
RE: Button in chat window - by posseke on 11-29-2005 at 07:46 PM
RE: Button in chat window - by posseke on 11-29-2005 at 08:32 PM
RE: Button in chat window - by matty on 11-29-2005 at 09:17 PM
RE: Button in chat window - by posseke on 11-29-2005 at 10:03 PM
RE: Button in chat window - by RaceProUK on 11-29-2005 at 10:14 PM
RE: Button in chat window - by posseke on 11-29-2005 at 10:16 PM
RE: Button in chat window - by posseke on 11-29-2005 at 10:45 PM
RE: Button in chat window - by posseke on 11-29-2005 at 11:36 PM


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