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:
Public Function SetStatus(ByVal MsN_Status As Integer) 'You can change MsN_Status to any stauts you want. MsN_Handle = FindWindow(vbNullString, "msn messenger") If MsN_Handle <> 0 Then Call SendMessage(MsN_Handle, WM_Command, GetMenuItemID(GetSubMenu(GetSubMenu(GetMenu(MsN_Handle), 0), 5), MsN_Status), 0&) Else MsN_Handle = FindWindow("MSNHiddenWindowClass", vbNullString) If MsN_Handle <> 0 Then Call SendMessage(MsN_Handle, WM_Command, GetMenuItemID(GetSubMenu(GetSubMenu(GetMenu(MsN_Handle), 0), 5), MsN_Status), 0&) Else Call MsgBox("MSN Messenger is not running!", vbCritical, "Error") End If End If 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!




Reply With Quote