hxr0x Posted March 7, 2005 Posted March 7, 2005 Hello, i've a stupid question, but i hope that anyone could help me. i work with RealVNC a lot and there are always three or more windows opened. i tinkered a AU-script to hide this windows by hotkey which was no problem for me. now i want to create a script to hide these windows from taskbar, when they are on SW_SHOW, to prevent them from showing in taskbar cauz my taskbar is getting fuller and fuller of this annoying VNC-"buttons". the windows should keep visible - only the taskbar buttons should be hidden. could this be done with autoit? Thank you for your effort! hxr0x
CyberSlug Posted March 7, 2005 Posted March 7, 2005 This might help. However, if you minimize the window it "disappears"...Run("calc") WinWait("Calculator") $window = WinGetHandle("Calculator") $newParent = WinGetHandle("Program Manager") DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $window, "hwnd", $newParent)See http://www.autoitscript.com/forum/index.php?showtopic=81 for more info Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
hxr0x Posted March 7, 2005 Author Posted March 7, 2005 Thank you! This is it This might help. However, if you minimize the window it "disappears"...
Buffo Posted September 28, 2005 Posted September 28, 2005 (edited) Hi, A question: I need a function that hides an application in taskbar but it should be shown in ALT+TAB dialog so that I can switch back to this application. Something like: ; $strWindowTitle = window title as string ; $blnVisible = visible as boolean Func ShowInTaskbar($strWindowTitle, $blnVisible) If $blnVisible = True Then {Code to show window in taskbar} Else {Code to hide window in taskbar} EndIf EndFunc How can I do that? Cu, Buffo Edited September 28, 2005 by Buffo
Buffo Posted September 29, 2005 Posted September 29, 2005 Does no one know how to hide the taskbar button only?
this-is-me Posted September 29, 2005 Posted September 29, 2005 (edited) You would have to give the target window the $WS_EX_TOOLWINDOW extended style. Edited September 29, 2005 by this-is-me Who else would I be?
Buffo Posted September 29, 2005 Posted September 29, 2005 It should be for external apps, not for GUIs created by AutoIt.
this-is-me Posted September 29, 2005 Posted September 29, 2005 (edited) ...and? Are you asking how to apply that style to an external window?I believe you can use this:http://www.autoitscript.com/forum/index.ph...wtopic=9517&hl=and the function _TargetStyle() in it to set the external window's extended style to $WS_EX_TOOLWINDOW Edited September 29, 2005 by this-is-me Who else would I be?
Buffo Posted September 29, 2005 Posted September 29, 2005 That's new to me. Interesting ... But I don't know what's the right code. I tried with my opened AutoIt-Help-Window: #include <AnyGUI.au3> _GUITarget("AutoIt Help") _TargetStyle("set", -1, -1, $WS_EX_TOOLWINDOW, 1) But it don't work for me What code I have to use for hide and for show? Thx a lot. Cu, Buffo
this-is-me Posted September 29, 2005 Posted September 29, 2005 Sorry to say I have never used the AnyGui.au3 myself, I usually do it the hard way. Maybe the author of the UDF can tell you what needs to be done to get it working. Who else would I be?
Buffo Posted September 29, 2005 Posted September 29, 2005 Sorry, I thought you know the UDF. I've sent a PM to the author. Perhaps he can help me. Thx for your help :-)
quaizywabbit Posted September 29, 2005 Posted September 29, 2005 (edited) That's new to me. Interesting ... But I don't know what's the right code. I tried with my opened AutoIt-Help-Window:#include <AnyGUI.au3> _GUITarget("AutoIt Help") _TargetStyle("set", -1, -1, $WS_EX_TOOLWINDOW, 1)But it don't work for me What code I have to use for hide and for show?Thx a lot.Cu,Buffo #include <ANYGUIv2.6.au3> $mywindow = _GuiTarget("AutoIt Help") $mywindowstyles = _TargetStyle("set", 1, -1, $WS_EX_TOOLWINDOW, $mywindow)try that.....P.S. the code above assumes you placed ANYGUIv2.6.au3 in your include folder Edited September 30, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8
Buffo Posted September 30, 2005 Posted September 30, 2005 Thx for your support I know that the include-command is for including from include folder, but for testing purposes I put your UDF renamed AnyGui.au3 in my local folder. Your code does the following: The window style of the help file becomes to toolbar style, but the button in taskbar remains. So this is not the solution, too. Please help me, I need another tip Cu, Buffo
Buffo Posted September 30, 2005 Posted September 30, 2005 While searching the web for examples in other programming languages I found the following VB-Script. Maybe someone can interpret this and help me in AutoIt.----------------Preparations----------------Add 2 Command Buttons to your form.----------------Module Code----------------Public Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPublic Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As LongPublic Declare Function ShowWindow Lib "user32" (ByVal hwnd _ As Long, ByVal nCmdShow As Long) As Long Public Const SW_HIDE = 0Public Const SW_SHOW = 5 Public Const GWL_EXSTYLE = (-20)Public Const WS_EX_TOOLWINDOW = &H80& Public Sub setShowInTaskbar(Visible As Boolean, hwnd As Long) Dim L As Long L = ShowWindow(hwnd, SW_HIDE) DoEvents L = SetWindowLong(hwnd, GWL_EXSTYLE, IIf(Visible, -WS_EX_TOOLWINDOW, WS_EX_TOOLWINDOW)) DoEvents L = ShowWindow(hwnd, SW_SHOW)End Sub--------------Form Code--------------Private Sub Command1_Click() Call setShowInTaskbar(True, Me.hwnd)End Sub Private Sub Command2_Click() Call setShowInTaskbar(False, Me.hwnd)End Sub
quaizywabbit Posted September 30, 2005 Posted September 30, 2005 Thx for your support I know that the include-command is for including from include folder, but for testing purposes I put your UDF renamed AnyGui.au3 in my local folder.Your code does the following: The window style of the help file becomes to toolbar style, but the button in taskbar remains. So this is not the solution, too.Please help me, I need another tip Cu,Buffo hmmmm...........try 'unsetting' $WS_EX_APPWINDOW from the extended styles of your window....worth a shot... [u]Do more with pre-existing apps![/u]ANYGUIv2.8
LxP Posted September 30, 2005 Posted September 30, 2005 Here's my feeble attempt at translating your VB code. I just tried it and got some very weird results though; can anyone see any obvious glitches? -- global const $SW_HIDE = 0 global const $SW_SHOW = 5 global const $GWL_EXSTYLE = -20 global const $WS_EX_TOOLWINDOW = 0x80 func setShowInTaskbar($visible, $handle) local $setting = $WS_EX_TOOLWINDOW if $visible then $setting = 0 - $WS_EX_TOOLWINDOW dllCall("user32.dll", "long", "ShowWindow", "hwnd", $handle, "long", $SW_HIDE) dllCall("user32.dll", "long", "SetWindowLong", "hwnd", $handle, "int", $GWL_EXSTYLE, "long", $setting) dllCall("user32.dll", "long", "ShowWindow", "hwnd", $handle, "long", $SW_SHOW) endFunc setShowInTaskbar(false, winGetHandle("Some window's title"))
quaizywabbit Posted September 30, 2005 Posted September 30, 2005 I think the problem now, after altering the style/exstyles of the window, is that the taskbar is not updating(redrawing) [u]Do more with pre-existing apps![/u]ANYGUIv2.8
Buffo Posted October 2, 2005 Posted October 2, 2005 (edited) @LxP: Great job! Unfortunalety the window will be completely hidden. But for what I want to do it's not important, I can use it @quaizywabbit: Maybe that's the problem, I don't know. @all: Thx a lot for your tireless support Cu, Buffo Edited October 2, 2005 by Buffo
kaca Posted March 6, 2006 Posted March 6, 2006 I wanted to hide WinAmp's taskbar button (WinAmp3 on Win XP SP2) with your code but nothing happened. I tried to cycle through all WinAmp windows: Opt("WinTitleMatchMode",4) $win = WinList("classname=BaseWindow_RootWnd") MsgBox(0,"Windows:",$win[0][0]) $newParent = WinGetHandle("Program Manager") For $i=1 to $win[0][0] MsgBox(0,$i&"-th window title:",$win[$i][0]) DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $win[$i][1], "hwnd", $newParent) Next but the taskbar button stayed there. WinSetStyle(@SW_HIDE) doesn't hide the button, too. Any ideas?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now