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!