Jump to content

Hide taskbar window?


kjpolker
 Share

Recommended Posts

If anyones interested, you can manipulate the teskbar items as a toolbar control, I believe the taskbar item text is always the same as the window title, if not then this will fail!

#include<Memory.au3>
#include<SendMessage.au3>

$hGUI = GUICreate ("lol!!")
GUISetState ()
Sleep (1000)
_HideTaskBarItem ($hGUI)
Sleep (5000)

Func _HideTaskBarItem ($hWnd, $sText = "")
   Local $sTitle = WinGetTitle ($hWnd, $sText), $hTray = ControlGetHandle ("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]")

   For $i = 0 to _SendMessage($hTray, 1024 + 24)
      $sText = _ToolbarGetText ($i)
      If $sText = $sTitle Then Return _SendMessage($hTray, 1024 + 22, $i)
   Next
   Return SetError (1, 0, 0)
EndFunc ; ==> _HideTaskBarItem

Func _ToolbarGetText($iCommandID) ; stolen and edited from GUIToolbar.au3
    Local $hTray = ControlGetHandle ("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; INSTANCE:2]"), _
      $iBuffer = _SendMessage($hTray, 1024 + 75, $iCommandID)
    If $iBuffer = 0 Then Return SetError(True, 0, "")
    If $iBuffer = 1 Then Return SetError(False, 0, "")
    If $iBuffer <= -1 Then Return SetError(False, -1, "")

    $iBuffer += 1
    $iBuffer *= 2

    Local $tBuffer = DllStructCreate("wchar Text[" & $iBuffer & "]"), $pBuffer = DllStructGetPtr($tBuffer), $iRet
    Local $tMemMap, $pMemory = _MemInit($hTray, $iBuffer, $tMemMap)
    $iRet = _SendMessage($hTray, 1024 + 75, $iCommandID, $pMemory, 0, "wparam", "ptr")
    _MemRead($tMemMap, $pMemory, $pBuffer, $iBuffer)
    _MemFree($tMemMap)
    Return SetError($iRet > 0, 0, DllStructGetData($tBuffer, "Text"))
EndFunc ; ==> _ToolbarGetText

Mat

Link to comment
Share on other sites

  • 1 month later...

The trick is "$WS_EX_TOOLWINDOW"

ie.

$Form1 = GUICreate($title, $width, $height, $left, $top, BitOR($WS_DLGFRAME, $WS_POPUP), $WS_EX_TOOLWINDOW)

or.............

$hParent = GUICreate('')

$hForm = GUICreate('MyGUI', 400, 400, -1, -1, -1, -1, $hParent)

Edited by Fidel
Link to comment
Share on other sites

i use

$gui = Guicreate (':o',200,50,-1,-1,-1,-1,Wingethandle ('[CLASS:Progman]',''))
GUisetstate ()
While GUIGetMsg () <> -3
wend
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...