RE: Plugin Request: Auto-Restoring Conversation Windows
'Being the bored person I am I made a small example. This is the code in Visual Basic on how you would do it. I just don't have the time to make it a plugin.
'Make sure to set a reference to the MessengerAPI Type Library
Public WithEvents MessengerAPI As MessengerAPI.Messenger
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_NORMAL = 1
Public Const SW_MINIMIZE = 6
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOWNOACTIVATE = 4
Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
Initialize = True
Set MessengerAPI = oMessenger
End Function
Private Sub MessengerAPI_OnIMWindowCreated(ByVal pIMWindow As Object)
Dim IMWindow_Interface As IMessengerConversationWnd
Set IMWindow_Interface = pIMWindow
' This will show the window normally with focus
ShowWindow IMWindow_Interface.hWnd, SW_NORMAL
' This will maximize the window
ShowWindow IMWindow_Interface.hWnd, SW_MAXIMIZE
' This will minimize the window
ShowWindow IMWindow_Interface.hWnd, SW_MINIMIZE
' This will minimize the window
ShowWindow IMWindow_Interface.hWnd, SW_MINIMIZE
' This will show the window normally without gaining focus
ShowWindow IMWindow_Interface.hWnd, SW_SHOWNOACTIVATE
End Sub
|