AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] How to resize Taskbar?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
HuBa



Joined: 24 Feb 2007
Posts: 172
Location: Budapest, Hungary

PostPosted: Sat Nov 24, 2007 11:39 pm    Post subject: [SOLVED] How to resize Taskbar? Reply with quote

It seems that the Windows XP Taskbar is immune to the WinMove command.
It doesn't matter if it is locked or not.

I use the Taskbar in vertical position and I want to change it's width.

Here are the basics, you can change the WinMove params to see the effect:
Code:

WinGetPos tb_X, tb_Y, tb_Width, tb_Height, ahk_class Shell_TrayWnd
WinMove ahk_class Shell_TrayWnd, , %tb_X%, %tb_Y%, %tb_Width%, %tb_Height%

I hope you can come up with an idea on how to resize the Taskbar because it doesn't work for me.


Last edited by HuBa on Sun Nov 25, 2007 3:08 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Sun Nov 25, 2007 1:10 pm    Post subject: Reply with quote

how about emulating over-the-edge mouse hover, click-and-hold, move, release...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
HuBa



Joined: 24 Feb 2007
Posts: 172
Location: Budapest, Hungary

PostPosted: Sun Nov 25, 2007 1:24 pm    Post subject: Reply with quote

wOxxOm wrote:
how about emulating over-the-edge mouse hover, click-and-hold, move, release...

Nice hack, but my Taskbar is locked, so I cannot resize it with mouse.

The workaround would be to unlock Taskbar, resize with mouse and unlock taskbar.

This would solve the problem but it is overkill and causes so much flickering to the desktop that it would be extremely annoying.
Back to top
View user's profile Send private message Visit poster's website
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Sun Nov 25, 2007 2:05 pm    Post subject: Reply with quote

dig deeper Smile Manipulating The Windows Taskbar - 424 "Locks the taskbar", maybe it'll help
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Sun Nov 25, 2007 2:16 pm    Post subject: Reply with quote

You may try the following, may resize the taskbar with a few key presses even if it's locked.
Code:
idx   := 2   ; 0-based index of the item

WinGet, hWnd, ID, ahk_class Shell_TrayWnd
hMenu := DllCall("GetSystemMenu", "Uint", hWnd, "int", False)
idn   := DllCall("GetMenuItemID", "Uint", hMenu, "int", idx)
WinActivate, ahk_id %hWnd%
PostMessage, 0x112, idn, 0, , ahk_id %hWnd%   ; WM_SYSCOMMAND
Back to top
View user's profile Send private message
HuBa



Joined: 24 Feb 2007
Posts: 172
Location: Budapest, Hungary

PostPosted: Sun Nov 25, 2007 2:18 pm    Post subject: Reply with quote

wOxxOm wrote:
dig deeper Smile Manipulating The Windows Taskbar - 424 "Locks the taskbar", maybe it'll help

This list is very interesting on it's own but I'm afraid I doesn't help.

So I need a resize method without affecting the "lockness" Smile of the Taskbar.
Back to top
View user's profile Send private message Visit poster's website
HuBa



Joined: 24 Feb 2007
Posts: 172
Location: Budapest, Hungary

PostPosted: Sun Nov 25, 2007 2:39 pm    Post subject: Reply with quote

Sean wrote:
You may try the following, may resize the taskbar with a few key presses even if it's locked.
Code:
idx   := 2   ; 0-based index of the item

WinGet, hWnd, ID, ahk_class Shell_TrayWnd
hMenu := DllCall("GetSystemMenu", "Uint", hWnd, "int", False)
idn   := DllCall("GetMenuItemID", "Uint", hMenu, "int", idx)
WinActivate, ahk_id %hWnd%
PostMessage, 0x112, idn, 0, , ahk_id %hWnd%   ; WM_SYSCOMMAND

I tried this but nothing has happened.
Are you sure that the the "idn" in PostMessage is fine as naked?
I mean the syntax should be %idn%, or doesn't it?
Well I tried this way too but again nothing happened.
Back to top
View user's profile Send private message Visit poster's website
wOxxOm



Joined: 09 Feb 2006
Posts: 319

PostPosted: Sun Nov 25, 2007 2:48 pm    Post subject: Reply with quote

HuBa wrote:
So I need a resize method without affecting the "lockness" Smile of the Taskbar.
IMO being done through SendMessage the taskbar unlocking/locking won't create any visual hassle, so it seems to me a good workaround: unlock, resize (which otherwise won't do), lock.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Sun Nov 25, 2007 2:54 pm    Post subject: Reply with quote

HuBa wrote:
I tried this but nothing has happened.

How many times have you pressed the arrow keys?
As Taskbar isn't resized incrementally, you won't notice the effect until several presses of the key.
BTW, the idn of the SysCommand is pretty constant, so you may try it instead:
Code:
WinActivate, ahk_class Shell_TrayWnd  ; may be needed if auto-hide is on
PostMessage, 0x112, 0xF000,,, ahk_class Shell_TrayWnd  ; SC_SIZE
Back to top
View user's profile Send private message
HuBa



Joined: 24 Feb 2007
Posts: 172
Location: Budapest, Hungary

PostPosted: Sun Nov 25, 2007 3:08 pm    Post subject: Reply with quote

Sean wrote:

How many times have you pressed the arrow keys?
As Taskbar isn't resized incrementally, you won't notice the effect until several presses of the key.
BTW, the idn of the SysCommand is pretty constant, so you may try it instead:
Code:
WinActivate, ahk_class Shell_TrayWnd  ; may be needed if auto-hide is on
PostMessage, 0x112, 0xF000,,, ahk_class Shell_TrayWnd  ; SC_SIZE

IT HAS THE EFFECT!!!

Your previous script didn't worked, but now this works.

If I press the arrow key once then the size jumps by about 10 pixels.
But if I press Ctrl+Arrow then I can resize it by one pixel.

Thank you very much.
Back to top
View user's profile Send private message Visit poster's website
svi



Joined: 09 Oct 2006
Posts: 124
Location: Finland

PostPosted: Mon Nov 26, 2007 12:19 am    Post subject: Reply with quote

wOxxOm wrote:
how about emulating over-the-edge mouse hover, click-and-hold, move, release...

Quite few seem to know that pressing Win-key (or Ctrl+Esc, or activating the taskbar by other means) and then pressing Alt+Space opens the same menu as Alt+Space on other windows, with options Move, Resize, Close ("Close" closes the taskbar and opens a shutdown dialog).
Doesn't naturally work when locked, and few tests have shown that Resize doesn't always work properly (for me).
But PostMessage seems to be similar: some times the taskbar can be made smaller only by pressing "up" (taskbar on lower edge) and when cancelling (Esc) the taskbar minimizes (to unvisible) only (not before) then.

The (mentioned) PostMessage is in principal same as Alt + Space and resembles WinMove or ControlMove, but I couldn't make ControlMove to move taskbar either because it needs a control name or control's HWND, so it can't move the whole window, I guess ...

By the way, if you want to move taskbar (also locked) use 0xF010 instead of 0xF000. Use mouse after the first key press to test (to not to have to press tens of times or wait for key repetation).

(Text in italic may be "not the best possible expression")
_________________
Pekka Vartto
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Mon Nov 26, 2007 1:33 am    Post subject: Reply with quote

HuBa wrote:
Your previous script didn't worked, but now this works.

Then, the position of Size item in the system menu of the taskbar looks like not third (idx := 2) in your system.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group