Jump to content
Sign in to follow this  
SBrown

Hide from taskbar

Recommended Posts

SBrown

How can I apply the style $WS_EX_TOOLWINDOW to a regular window, such as firefox?

If that isn't possible, how can i set it on to and remove the item from the taskbar?

Share this post


Link to post
Share on other sites
Zedna

$newStyle = ...
$oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitOR($oldStyle, $newStyle))

In your case use GWL_EXSTYLE instead of GWL_STYLE because $WS_EX_TOOLWINDOW is exstyle and not style

Edited by Zedna

Share this post


Link to post
Share on other sites
SBrown

Im sorry, Im kinda new here at this.

Could you post the code that would do the entire thing? Its confusing for me :)

Edited by SBrown

Share this post


Link to post
Share on other sites
Zedna

Im sorry, Im kinda new here at this.

Could you post the code that would do the entire thing? Its confusing for me :)

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

$hWnd = WinGetHandle("Your window title", "Your window text")
$newStyle = $WS_EX_TOOLWINDOW
$oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)
_WinAPI_SetWindowLong($hWnd, $GWL_EXSTYLE, BitOR($oldStyle, $newStyle))

Share this post


Link to post
Share on other sites
SBrown

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

$hWnd = WinGetHandle("Your window title", "Your window text")
$newStyle = $WS_EX_TOOLWINDOW
$oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)
_WinAPI_SetWindowLong($hWnd, $GWL_EXSTYLE, BitOR($oldStyle, $newStyle))

Thanks, but the window goes smaller, like the style does, but it isnt topmost, nor out of the taskbar

Share this post


Link to post
Share on other sites
Zedna

I have seen some trick with setting parent to desktop window:

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

$hWnd = WinGetHandle("Your window title", "Your window text")
$parent = _WinAPI_GetDesktopWindow()
_WinAPI_SetParent($hWnd, $parent)

But it seems to not work too. Search forum. I'm sure there is answer for your question already.

Share this post


Link to post
Share on other sites
SBrown

Looking on msdn, i found WS_EX_APPWINDOW, which keeps the window in the bar, how do i subtract that now?

Share this post


Link to post
Share on other sites
Zedna

Looking on msdn, i found WS_EX_APPWINDOW, which keeps the window in the bar, how do i subtract that now?

Try this:

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

$hWnd = WinGetHandle("Your window title", "Your window text")
$oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)
$newStyle = BitOR($oldStyle, $WS_EX_TOOLWINDOW)
$newStyle = BitAND($newStyle, BitNOT($WS_EX_APPWINDOW))
_WinAPI_SetWindowLong($hWnd, $GWL_EXSTYLE, $newStyle)

Share this post


Link to post
Share on other sites
SBrown

Try this:

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

$hWnd = WinGetHandle("Your window title", "Your window text")
$oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)
$newStyle = BitOR($oldStyle, $WS_EX_TOOLWINDOW)
$newStyle = BitAND($newStyle, BitNOT($WS_EX_APPWINDOW))
_WinAPI_SetWindowLong($hWnd, $GWL_EXSTYLE, $newStyle)
nope dosnt work

Share this post


Link to post
Share on other sites
BinaryBrother

Its possible to load other applications through an AutoIt GUI, through that, you can define regular AutoIt GUI events... :P Hope that helped you a bit... :(

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.