Shoutbox

Temporarily remove desktop contacts - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: WLM Plus! General (/forumdisplay.php?fid=23)
+----- Thread: Temporarily remove desktop contacts (/showthread.php?tid=49257)

Temporarily remove desktop contacts by aC23 on 08-21-2005 at 01:45 AM

Sorry if this was already suggested, but it would be nice to have a feature that lets you temporarily take off all of your contacts from the desktop

i.e when playing a game, the icons still appear on your desktop, forcing you to either:

1. Close MSN competely
2. remove the contacts and be obliged to put them back on one by one when you're done.

So let's say if i were to change my status to Busy, the desktop icons would disappear until i change my status again.


RE: Temporarily remove desktop contacts by Val on 08-21-2005 at 02:49 AM

quote:
Originally posted by aC23
Sorry if this was already suggested, but it would be nice to have a feature that lets you temporarily take off all of your contacts from the desktop

i.e when playing a game, the icons still appear on your desktop, forcing you to either:

1. Close MSN competely
2. remove the contacts and be obliged to put them back on one by one when you're done.

So let's say if i were to change my status to Busy, the desktop icons would disappear until i change my status again.


Thats pretty cool MSGplus sould have to :) maybe stuffplug will make it
RE: Temporarily remove desktop contacts by cardshark on 08-24-2005 at 12:06 AM

Actually, if you use the privacy protection feature, it takes the contacts off the desktop. True, you won't know if you've gotten a message until you unlock Messenger, but it works if you don't care about missing messages (since you probably wouldn't want to be bothered while fullscreen anyway). However, I still agree that it would be a nice feature to have, just in case you go fullscreen but still want to be able to receive messages and all.


RE: Temporarily remove desktop contacts by uberdosis on 08-24-2005 at 12:33 AM

Don't have it showing on top of everything ?
right click on the contact on the desktop > change display settings > un-tick 'always on top'


RE: Temporarily remove desktop contacts by ShawnZ on 08-24-2005 at 12:46 AM

then he has to do it for each one, and renable them when he's done, so its the same as deleting them :undecided:


RE: Temporarily remove desktop contacts by Concord Dawn on 08-24-2005 at 12:48 AM

quote:
Originally posted by ShawnZ
then he has to do it for each one, and renable them when he's done, so its the same as deleting them :undecided:

Erm, there should be a button to enable/disable Desktop Contacts, does that not do what you want?
RE: RE: Temporarily remove desktop contacts by CookieRevised on 08-24-2005 at 02:29 AM

quote:
Originally posted by Concord Dawn
quote:
Originally posted by ShawnZ
then he has to do it for each one, and renable them when he's done, so its the same as deleting them :undecided:

Erm, there should be a button to enable/disable Desktop Contacts, does that not do what you want?

no there is no such button.

-----------

Anways, as cardshark has already suggested, make a Boss Protection Scheme in Messenger Plus! and activate it when you run the full screen game. This is the best you can do and will act exactly as you wish.
RE: Temporarily remove desktop contacts by matty on 08-24-2005 at 02:49 AM

If anyone wants to do this here is VB6 Code that will do so.

code:
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public NumOfFloatingWindows As Long
Public Floating_hWnd() As Long
Public Function CallBack(ByVal hwnd As Long, ByVal lpData As Long) As Long
   Dim lResult As Long
   Dim sWndName As String
   Dim sClassName As String
   Dim nWindowHandle As String
   CallBack = 1
   sClassName = Space(260)
   sWndName = Space(260)
   lResult = GetClassName(hwnd, sClassName, 260)
   sClassName = Left$(sClassName, lResult)
   lResult = GetWindowText(hwnd, sWndName, 260)
   sWndName = Left$(sWndName, lResult)
   If LCase$(sClassName) = "msgplusfloatingwindow" Then
       ReDim Preserve Floating_hWnd(NumOfFloatingWindows)
       Floating_hWnd(NumOfFloatingWindows) = FindWindow("msgplusfloatingwindow", sWndName)
       ShowWindow Floating_hWnd(NumOfFloatingWindows), SW_HIDE
       NumOfFloatingWindows = NumOfFloatingWindows + 1
   End If
End Function
Public Function HideFloatingWindows() As Boolean
   Dim hwnd As Long
   EnumWindows AddressOf CallBack, hwnd
End Function
Public Function ShowFloatingWindows()
   For j = NumOfFloatingWindows - 1 To 0 Step -1
       DoEvents
       ShowWindow Floating_hWnd(j), SW_NORMAL
   Next
End Function


to hide the windows
code:
HideFloatingWindows

and to show them
code:
ShowFloatingWindows

RE: Temporarily remove desktop contacts by CookieRevised on 08-24-2005 at 03:59 AM

I took the liberty to fix (it doesn't work) and improve Matty's code.... sorry matty ;) :p


code:
Option Explicit

Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Private Const SW_HIDE = 0
Private Const SW_SHOWNA = 8

' The callback function. This MUST be in a normal module (not a class module)
Private Function CallBack(ByVal hWnd As Long, ByVal lParam As Long) As Long
   Dim lResult As Long
   Dim sClassName As String * 260
   
   lResult = GetClassName(hWnd, sClassName, Len(sClassName))
   If LCase$(Left$(sClassName, lResult)) = "msgplusfloatingwindow" Then
       If lParam Then
           ShowWindow hWnd, SW_SHOWNA
       Else
           ShowWindow hWnd, SW_HIDE
       End If
   End If
   
   CallBack = True
   
End Function


' Two seperate public procedures to show and hide the windows
Public Sub ShowFloatingWindows()
   EnumWindows AddressOf CallBack, True
End Sub
Public Sub HideFloatingWindows()
   EnumWindows AddressOf CallBack, False
End Sub


' Only one public procedure which can do both (with optional parameter)
'    To show windows: FloatingWindowsState True
'    To hide windows: FloatingWindowsState False
'    If the (true/false) parameter is omitted it will also show the windows

Public Sub FloatingWindowsState(Optional State As Boolean = True)
   EnumWindows AddressOf CallBack, State
End Sub


Note 1: as you can see you don't need the two seperate procedures, you can do it with one also. It depends on what you prefer I assume...

To make the code even shorter you can also do this
code:
If LCase$(Left$(sClassName, lResult)) = "msgplusfloatingwindow" Then
    ShowWindow hWnd, -lParam * 8
End If
In that way you don't even need the private constants anymore and the code gets even smaller (because there is no need for the second IF THEN ELSE anymore)...

Note 2: As you'll notice I didn't use the SW_NORMAL constant as others would do, but the SW_SHOWNA constant instead. This is because SW_NORMAL will also make the floating windows active (it sets the focus to them), SW_SHOWNA does not. More info on this can be found in the MSDN library: ShowWindow.


Download the attachment for the complete VB6 project files (using the short method)

-------------------------------

EDIT: The included compiled exe file has basically the same functionality as the one from Fergy. But it will not loose focus (because I used SW_SHOWNA instead of SW_NORMAL) when you show the floating windows. And you can also start it up with a parameter "hide" or "show":

plusfloatingwindows => Will start up as normal and will show you the two buttons
plusfloatingwindows hide => Will hide the floating windows immediatly without showing any window
plusfloatingwindows show => Will show the floating windows immediatly without showing any window (in fact, instead of "show" you can use whatever you like :p)

Note: as it is an VB program it requires the useuall VB6 runtime library to be present on your system (MSVBVM60.DLL), if you don't have it (aka if you get an error when you start the program) download it here and install it.
RE: Temporarily remove desktop contacts by Fergy on 08-24-2005 at 06:44 AM

For those who do not have visual basic, i decided to make a .EXE file so you can use it

Edit: cookierevised has included a .exe file in his .zip package, so I reccomend you download that


RE: Temporarily remove desktop contacts by CookieRevised on 08-24-2005 at 06:46 AM

quote:
Originally posted by Fergy
For those who do not have visual basic, i decided to make a .EXE file so you can use it
which doesn't work
RE: Temporarily remove desktop contacts by Fergy on 08-24-2005 at 06:53 AM

oops, didnt see that one anyway it's fixed

edit: download cookierevised's version, it's better (Y)


RE: Temporarily remove desktop contacts by aC23 on 08-24-2005 at 04:11 PM

Thanks, but there's a problem :S

Whenever you hide the contacts, all the icons disappear (perfect!) but whenever you put them back, ALL contacts which you specified in Plus! appear on your desktop, Offline or not.


RE: RE: Temporarily remove desktop contacts by CookieRevised on 08-24-2005 at 06:03 PM

quote:
Originally posted by aC23
Thanks, but there's a problem :S

Whenever you hide the contacts, all the icons disappear (perfect!) but whenever you put them back, ALL contacts which you specified in Plus! appear on your desktop, Offline or not.

the code presented (and thus used in those exe's) is just very basic and proof-of-concept.

It doesn't include any reference to MSN Messenger or Messenger Plus! at all, hence it can't detect that. Note that also whenever Plus! changes the window (because the contact changed his status), it is shown again according to your Plus! preferences for displaying desktop contact.

If you want something more advanced, you need to make an integrated plugin or addon which constantly monitors changes in contact statusses and intercepts them, read out the preferences (read out the registry), etc...

As with all things, it is never as easy as it first seems.

Another, rather dodgy, approach could be to unset the always-on-top status of all the windows, but first safe it to an array so you can restore it later (note: and this isn't so easy as it sounds either, as the email addresses of the contacts which are floating are also encrypted in the registry). But as with all things this also has some drawbacks and will result in errors as one could change those states in Plus! while the application is running. Thus again it will result in wrong windows showing when you "reset" it back.

Hence, the reason why I suggested to use the already build-in function of Messenger Plus!: Boss Protection; you can't beat that when it comes to hiding the (topmost) windows when you run a full screen app. It does exactly what you want.

You don't have to invent the wheel twice... Simply use what is already there for you to be used...
RE: Temporarily remove desktop contacts by aC23 on 08-25-2005 at 01:18 AM

Guess the Boss Protection feature could work too.