|
-
Oct 25th, 2005, 01:56 AM
#1
Thread Starter
Lively Member
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:
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!
-
Oct 25th, 2005, 02:48 AM
#2
Hyperactive Member
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:
Dim x As New MessengerAPI.Messenger
If x.MyStatus <> MISTATUS_OFFLINE Then
x.MyStatus = MISTATUS_BUSY
Else
MsgBox "Msn is offline"
End If
Let me know it works ok.
-
Oct 25th, 2005, 04:58 PM
#3
Thread Starter
Lively Member
Re: Change MSN Status While In SysTray
I'm glad you read my entire post 
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|