Results 1 to 3 of 3

Thread: Change MSN Status While In SysTray

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    110

    Change MSN Status While In SysTray

    I was wondering if anybody could help me out on this.
    I know it's not my code, but I've tried to alter it and I understand the code, and am having no luck

    VB Code:
    1. Public Function SetStatus(ByVal MsN_Status As Integer)
    2.  
    3.     'You can change MsN_Status to any stauts you want.
    4.    
    5.     MsN_Handle = FindWindow(vbNullString, "msn messenger")
    6.    
    7.     If MsN_Handle <> 0 Then
    8.         Call SendMessage(MsN_Handle, WM_Command, GetMenuItemID(GetSubMenu(GetSubMenu(GetMenu(MsN_Handle), 0), 5), MsN_Status), 0&)
    9.    
    10.     Else
    11.    
    12.        MsN_Handle = FindWindow("MSNHiddenWindowClass", vbNullString)
    13.        
    14.        If MsN_Handle <> 0 Then
    15.         Call SendMessage(MsN_Handle, WM_Command, GetMenuItemID(GetSubMenu(GetSubMenu(GetMenu(MsN_Handle), 0), 5), MsN_Status), 0&)
    16.        Else
    17.         Call MsgBox("MSN Messenger is not running!", vbCritical, "Error")
    18.        End If
    19.        
    20.     End If
    21.  
    22. End Function


    So basically it checks if MSN is in the taskbar, and if that fails, it uses the MSNHiddenWindowClass for the handle instead. But it's not changing the status for the SysTray one, but it is when the program is in the taskbar. So I'm guessing the little MSN icon in your SysTray relays messages a bit differently. Anyways, if anybody can tell me how to change the status without having to use the MSN API because it's sort of an inconvenience when it comes to loading. Thanks!

  2. #2
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    UK, Suffolk
    Posts
    319

    Talking Re: Change MSN Status While In SysTray

    ok to do this you need to add the 'Messanger API Type Library' Refrence

    Then i used the following code inside a command button.

    VB Code:
    1. Dim x As New MessengerAPI.Messenger
    2.  
    3. If x.MyStatus <> MISTATUS_OFFLINE Then
    4.     x.MyStatus = MISTATUS_BUSY
    5. Else
    6.     MsgBox "Msn is offline"
    7. End If

    Let me know it works ok.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    110

    Re: Change MSN Status While In SysTray

    I'm glad you read my entire post

    Quote Originally Posted by ChR0NiC
    Anyways, if anybody can tell me how to change the status without having to use the MSN API because it's sort of an inconvenience when it comes to loading. Thanks!

    Thanks for the thought though.

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