Jump to content

Hide a window


Recommended Posts

Hi there,

Posted Image

I made my taskbaks trans with 196 (winsettrans)

Moved my winamp under the taskbar, you can see by the red arrow.

Only i want to remove the window in the taskbar, the green arrow.

So my question:

How to remove a exiting window of an other application from the taskbar, but dont remove the window it self from the screen?

Sorry for my bad english.

-jaenster

-jaenster

Link to comment
Share on other sites

You may want to have the thing you made at the top of your screen in the center. That way it would not interfere with the taskbar. From what you are asking, you want to hide the information about the WinAmp file being played from the taskbar. I'm not sure on how you do that. You may need to google to see if someone has got a solution to what you are asking for. I've never seen anyone do something like that in Autoit.

Link to comment
Share on other sites

#include <Constants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Run(@ProgramFilesDir & '\winamp\winamp.exe')
WinWaitActive('Winamp')

Dim $hPlayer = WinGetHandle('[CLASS:Winamp v1.x]')
Dim $iStyle = _WinAPI_GetWindowLong($hPlayer, $GWL_STYLE)
Dim $iExStyle = _WinAPI_GetWindowLong($hPlayer, $GWL_EXSTYLE)

_WinAPI_ShowWindow($hPlayer, @SW_HIDE)

_WinAPI_SetWindowLong($hPlayer, $GWL_STYLE, BitOR(BitAND($iStyle, _
                        BitNOT($WS_OVERLAPPEDWINDOW)), $WS_POPUP))
                        
_WinAPI_SetWindowLong($hPlayer, $GWL_EXSTYLE, BitOR($iExStyle, $WS_EX_TOOLWINDOW))

_WinAPI_ShowWindow($hPlayer, @SW_SHOW)

It looks strange but working.

Change the class name according to your winamp version or class name.

Link to comment
Share on other sites

Sorry, I gave you example that works on my computer because I've tested it and inspected it's styles and extended styles using WinSpy. I don't know what is the versions and style of your Winamp but globally that is the way to do it.

Edit: Typically, Winamp is built up of three main windows - the EQ the library editor and the player window. You can try to hide each a time and see which makes the task bar button to disappear, this one's style need to be AND'ed with NOT WS_OVERLAPPEDWINDOW and OR'ed with WS_POPUP style. Then, all that is needed is to OR it's extended style with WS_EX_TOOLWINDOW (require to hide and show to disable it's task bar button).

Edited by Authenticity
Link to comment
Share on other sites

i still dont get it

My code right now:

Dim $hPlayer = _getwinamphandle()
consolewrite('winamp handle:'&$hplayer&@crlf)
_WinAPI_SetWindowLong($hPlayer, $GWL_EXSTYLE, $WS_EX_TOOLWINDOW)
_WinAPI_SetWindowLong($hPlayer, $GWL_style,bitand($WS_POPUPWINDOW,$WS_POPUP))

func _getwinamphandle()
    $var = winlist()
    For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
      If $var[$i][0] <> "" Then
        Consolewrite($var[$i][0]&@crlf)
        if stringinstr($var[$i][0],"- Winamp") > 0 then
            Return $var[$i][1]
        endif
        if $var[$i][0] = "Winamp Equalizer" then
            $WinampHandle2 = $var[$i][1]
        endif
      EndIf
    Next
endfunc

-jaenster

Link to comment
Share on other sites

Nope, your code just overwrite entirely the window style and extended style.

Also, BitAND($WS_POPUPWINDOW, $WS_POPUP) will result in just $WS_POPUP because it's:

WS_POPUP & WS_POPUPWINDOW
0x80000000 & 0x80880000 = 0x80000000 or WS_POPUP

and the rest of the style is not taken into consideration which may be also WS_CLIPSIBLINGS etc...

You can drop the loop because you know how to get the handle to the window using WinGetHandle('Winamp'), which in this case is probably a unique class name I guess, or use AutoIt Window Info to get a unique attribute of the Winamp window.

Can you post three summaries of the Winamp window: EQ, editor and player?

Edited by Authenticity
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...