Remove window from taskbar

Post your working scripts, libraries and tools
sobuj53
Posts: 35
Joined: 19 Mar 2015, 16:08

Remove window from taskbar

13 Feb 2018, 22:40

This is not an original topic. The original topic is located here, https://autohotkey.com/board/topic/5112 ... m-taskbar/. The only reason I needed to open anther one is because I can't reply to that topic as it was archived. OK so, I've modified the original scrips so that it can remove already open window from taskbar,

1st script is,

Code: Select all

^W::
DetectHiddenWindows on
SetTitleMatchMode, 2
DetectHiddenText, On

VM_Cls=ahk_class VMUIFrame
VM_Prcs=vmware.exe

; This toggle the Hidden status of the VMWare window
If ProcessExist(VM_Prcs)
	{
		WinGet, hw_VMware, ID, %VM_Cls%
		WinWait %VM_Cls%
		WinHide
		WinSet, ExStyle, ^0x80; 0x80 is WS_EX_TOOLWINDOW
		WinShow
		WinMaximize, ahk_id %hw_VMware% ; Window  is Maximized 
	}
Return

ProcessExist(Name)
{
	Process,Exist,%Name%
	return Errorlevel
}
or you can use this one,

Code: Select all

^W::
SetTitleMatchMode RegEx
DetectHiddenWindows, On
DetectHiddenText, On

;Change here
VM_Cls=ahk_class VMUIFrame
VM_Prcs=vmware.exe

if !WinExist(VM_Cls)

{
;  Failure to WinGet VMWare ID!
	
	If ProcessExist(VM_Prcs)
	{
	
		DllCall( "SetParent", "uint", hw_VMware, "uint", hw_parent )
		WinMaximize, ahk_id %hw_VMware%
		Return
	}
	
}

WinGet, hw_VMware, ID, %VM_Cls%
hw_parent := DllCall( "GetParent", "uint", hw_VMware )
WinGet, hw_progman, ID, Program Manager ahk_class Progman

DllCall( "SetParent", "uint", hw_VMware, "uint", hw_progman )
WinMaximize, ahk_id %hw_VMware%
Return 
ProcessExist(Name)
{
	Process,Exist,%Name%
	return Errorlevel
}
Although I had problem with the 2nd script in some windows 7 version but the 1st one worked in all version of windows for me.
This script is particularly useful when running virtual machine in duel monitor working 2 person in one CPU. This removes the taskbar window from host monitor.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 34 guests