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 

Window "roll-up" to menu title

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





PostPosted: Tue May 25, 2004 10:26 pm    Post subject: Window "roll-up" to menu title Reply with quote

Hi! There are small utility programs (one of them is called "cool mouse")that "roll up the active window to its title bar", meaning that if you click for example with your Mouse Wheel button on the title bar of Word the whole text window disappears and only the menu title remains on the desktop giving easy access to other apps.

Is there any way, perhaps controlsend something, to implement this in AHK?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue May 25, 2004 11:44 pm    Post subject: Reply with quote

I'm not sure exactly how those rollup (shading) programs work, since I couldn't locate any source code on the net. However, the following might be a primitive solution:
Code:
#space::
WinGetPos, , , , active_height, A
if active_height > 30  ; Value needs to be a little larger to allow it to work.
   WinMove, A, , , , , 25
else
{
   ;WinGetPos, , , , desk_height, Program Manager
   ;WinMove, A, , , , , %desk_height%
   WinRestore, A
   WinMaximize, A
}
return

If desired, the above can be embellished by having a mouse double-click detected in the title bar, in which case the window will be rolled up or unrolled. You could also have it store the original size of the window in variables so that the window can be restored to exactly how it was before (rather than maximized).
Back to top
View user's profile Send private message Send e-mail
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Tue May 25, 2004 11:46 pm    Post subject: Reply with quote

I'm sure someone else will come up with a better way but this seems to work-

Code:


~Mbutton::

Delay = 20 ;set time to hold middle button before window moves here

HowLong = 0

Loop
{
HowLong ++
Sleep, 10
GetKeyState, MButton, MButton, P
IfEqual, MButton, U, Break
}
IfLess, HowLong, %Delay%, Return


WinGetTitle, OutputVar, A ;Gets the windows title

winactivate ; activates the window

WinRestore, %OutputVar%


;Change the width and Height of title bar here

WinMove, %OutputVar%, , 0, 0, 500, 35 ;




Last edited by Jon on Wed May 26, 2004 5:22 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue May 25, 2004 11:48 pm    Post subject: Reply with quote

That looks nice and its a good use of the middle mouse button.

Also of possible interest:
FreeShade (Donationware)
http://www.hmmn.org/FreeShade/
http://www.hmmn.org/FreeShade/beta.html
Back to top
View user's profile Send private message Send e-mail
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Wed May 26, 2004 12:05 am    Post subject: Reply with quote

other guys beat me to this reply ...i'd also written a script but now its not needed. Smile
_________________
Back to top
View user's profile Send private message
JGarf
Guest





PostPosted: Wed May 26, 2004 11:09 pm    Post subject: Thanks Reply with quote

I modified the script so it undoes the roll up afterwards and keeps the original position.
Code:
~Mbutton::

Delay = 20 ;set time to hold middle button before window moves here

HowLong = 0

Loop
{
HowLong ++
Sleep, 10
GetKeyState, MButton, MButton, P
IfEqual, MButton, U, Break
}
IfLess, HowLong, %Delay%, Return

WinGetTitle, OutputVar, A ;Gets the windows title
winactivate ; activates the window
WinRestore, %OutputVar%
WinGetPos, X, Y,Width, Height , A  ; "A" to get the active window's pos.
If Height = 35
{
WinMove, %OutputVar%, ,%X%, %Y%,%Width%, %StoredHeight%
}
else
{
WinMove, %OutputVar%, ,%X%, %Y%,%Width%, 35 ;
StoredHeight=%Height%
}
return


Now it works somehow as the window is being rolled up. Problem is that if you do it to more windows you will not be able to recover all window positions. And besides, you can still see the frame of the window... Since now many progs have this feature, exists a window function that does it?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu May 27, 2004 1:41 am    Post subject: Reply with quote

Quote:
Since now many progs have this feature, exists a window function that does it?

I suspect there is, but it's not well publicized despite how many programs can do it. If anyone knows, I'll raise the priority of this item if it's not too hard to implement.
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Fri May 28, 2004 1:10 pm    Post subject: Reply with quote

Here's a good one. I'll try to apply its rollup technique and "minimize to tray" feature to a future version of AHK:

http://www.palma.com.au/winroll/
Make a window roll into its title bar, send it to the back or make it stay on top. Minimize, maximize or close all visible windows, including minimizing to the tray area. Make a window translucent on Windows 2000 or above. WinRoll is lovingly hand-crafted in 100% pure assembly language to give the fastest response and the smallest memory footprint. WinRoll is proudly a FREEWARE and OPEN SOURCE application.
Back to top
View user's profile Send private message Send e-mail
JGarf
Guest





PostPosted: Sat May 29, 2004 11:15 pm    Post subject: Reply with quote

Cool! Looking forward to it!
Back to top
Guest






PostPosted: Sat Aug 07, 2004 10:58 pm    Post subject: MrB Reply with quote

Any News on the implementation plan?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Sat Aug 07, 2004 11:26 pm    Post subject: Reply with quote

Both window rollup and minimize-to-tray are still on the to-do list, but lower in priority than custom GUI forms/windows since I think more users would want and use that feature.

If you don't already know about them, here are a few scripts that might be a partial solution in the meantime:

Rajat's winshade script ("reduce windows to their title bars and then set them back to original size by a single hotkey"):
http://www.autohotkey.com/forum/viewtopic.php?t=556

The "minimize any window to tray menu" script:
http://www.autohotkey.com/docs/scripts/MinimizeToTrayMenu.htm

And a variant of the above by gl0x0r: http://www.autohotkey.com/forum/viewtopic.php?t=523
Back to top
View user's profile Send private message Send e-mail
whynot



Joined: 06 Aug 2004
Posts: 10

PostPosted: Sun Aug 08, 2004 3:08 am    Post subject: Blue Carpets WinShade Reply with quote

This is a program that's made to provide various mouse button/window interactions. For instance, you can set it up so that when you middle click a title bar, the window maximizes vertically, and when you right click a title, the window folds up, as per up as per the discussion here. There's a number of other possibilities also.

It used to be shareware, but was turned into freeware/abandonware awhile ago by Blue Carpet, its creators. It's very lightweight, and works great in XP, in addition to earlier versions of Windows.

The only drawback to using it with XP, or other themeing type of skins, is that the folded up Window reverts back to a Windows Classic look & feel until it's unfolded. Functionally, it's 100% cool.

You can find a download for it, as well as the neccesary reg info (again, provided by the company as a universal freeware reg when it was donated as freeware) at the following site: http://www.saunalahti.fi/eike/

I know it's not using AHK, but I've used it for years & thought others might appreciate as well since it meets the needs of this thread. Very Happy
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