Earlier today, I’ve made another post doing something very similar to this one. You can have a look at it here.
We are going to do the exact same thing actually, but this time, you will be able to use the code that I’m giving without any modification.
So, without further ado, here is the AutoIt code:
HotKeySet("!h", "ShowHideFloatingContacts") ; ALT+h as the hotkey
AutoItSetOption("WinTitleMatchMode", 4)
While 1
Sleep(100)
WEndFunc ShowHideFloatingContacts()
$hWindows = WinList("[CLASS:#32770]")
For $i = 1 to $hWindows[0][0]
$size= WinGetClientSize($hWindows[$i][1])If $size[1] = 23 Then
$state = WinGetState($hWindows[$i][1], "")
If Not BitAnd($state, 2) Then
WinSetState($hWindows[$i][1], "", @SW_SHOW)
Else
WinSetState($hWindows[$i][1], "", @SW_HIDE)
EndIf
EndIfNext
EndFunc
It works based on the fact that the height of these ‘contacts on desktop’, as far as I have observed, is always 23. You just can not make them longer. Well, I think by checking for this, it is a pretty unique way to identify these little windows.
If you don’t know how to use this code by utilizing AutoIt, check out my previous post.