 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Sat Nov 24, 2007 11:39 pm Post subject: [SOLVED] How to resize Taskbar? |
|
|
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 |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
Posted: Sun Nov 25, 2007 1:10 pm Post subject: |
|
|
| how about emulating over-the-edge mouse hover, click-and-hold, move, release... |
|
| Back to top |
|
 |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Sun Nov 25, 2007 1:24 pm Post subject: |
|
|
| 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 |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Sun Nov 25, 2007 2:16 pm Post subject: |
|
|
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 |
|
 |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Sun Nov 25, 2007 2:18 pm Post subject: |
|
|
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" of the Taskbar. |
|
| Back to top |
|
 |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Sun Nov 25, 2007 2:39 pm Post subject: |
|
|
| 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 |
|
 |
wOxxOm
Joined: 09 Feb 2006 Posts: 319
|
Posted: Sun Nov 25, 2007 2:48 pm Post subject: |
|
|
| HuBa wrote: | So I need a resize method without affecting the "lockness" 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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Sun Nov 25, 2007 2:54 pm Post subject: |
|
|
| 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 |
|
 |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Sun Nov 25, 2007 3:08 pm Post subject: |
|
|
| 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 |
|
 |
svi
Joined: 09 Oct 2006 Posts: 124 Location: Finland
|
Posted: Mon Nov 26, 2007 12:19 am Post subject: |
|
|
| 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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Mon Nov 26, 2007 1:33 am Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|