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 

WinTraymin to trayicon
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
TopDawggamer



Joined: 02 Jul 2008
Posts: 1

PostPosted: Wed Jul 02, 2008 3:01 pm    Post subject: Reply with quote

Thanks it works great now!

How could I change it so I could hold ctrl and right click the minimize button? That would work better for me.


Last edited by TopDawggamer on Wed Jul 02, 2008 3:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Wed Jul 02, 2008 3:19 pm    Post subject: Reply with quote

I thinks its better now.
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Thu Jul 03, 2008 3:06 am    Post subject: Reply with quote

The script is updated in the same link. The main change is WinActivate is replaced with WinShow & WinRestore.

TopDawggamer wrote:
How could I change it so I could hold ctrl and right click the minimize button?
If you're using the new one you can define the hotkey as
Code:
^RButton::h:=WM_NCHITTEST(), h ? WinTraymin(0,h) : ""
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1249
Location: USA

PostPosted: Fri Jul 04, 2008 5:45 am    Post subject: Reply with quote

Sean,
You could change the following in the download to make it easier to modify for new ahk users.
Code:
Else   Send, {%A_ThisHotkey%}

_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Fri Jul 04, 2008 9:33 am    Post subject: Reply with quote

ahklerner wrote:
Sean,
You could change the following in the download to make it easier to modify for new ahk users.
Code:
Else   Send, {%A_ThisHotkey%}

That's a good idea and the script is updated accordingly with a few additional improvements. As a matter of fact, I'm using similar one combined with gesture. It looks something like
Code:
If       IsLabel(Gesture)
         GoSub, %Gesture%
Else If  h:=WM_NCHITTEST()
         WinTraymin(0,h)
Else     Click, % SubStr(A_ThisHotkey,1,1)
Back to top
View user's profile Send private message
ABCza



Joined: 03 Jun 2008
Posts: 22
Location: Italy

PostPosted: Sat Jul 05, 2008 9:07 am    Post subject: Reply with quote

OMG this is fvckin awesome. After ScreenCapture another script that i need. Thank you Sean! Very Happy
_________________
ABCza
Back to top
View user's profile Send private message MSN Messenger
ABCza



Joined: 03 Jun 2008
Posts: 22
Location: Italy

PostPosted: Sat Jul 05, 2008 9:23 am    Post subject: Reply with quote

Incredible. But it's a little difficult to understand. Could you explain it or insert some lines of comment?
_________________
ABCza
Back to top
View user's profile Send private message MSN Messenger
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Sun Jul 06, 2008 12:05 am    Post subject: Reply with quote

ABCza wrote:
Could you explain it or insert some lines of comment?

Coming to documentation, you better resort to other members like SKAN as I tended to be too brief or too verbatim. Wink Fortunately, as I said already, most of the used codes have been around the forum a while.
For WM_NCHITTEST
http://www.autohotkey.com/forum/viewtopic.php?t=22178
For ShellHook
http://www.autohotkey.com/forum/viewtopic.php?t=8795&postdays=0&postorder=asc&start=285

And I will document how to use WinTraymin() and I'll change the order of the two (optional) parameters if there is no objection against it.

One thing which disturbs me most is that it could consume lots of (dynamically generated) global variables and naming pollution, due to the lack of true array support in AHK. At first I attempted to use Dictionary COM object but it seemed to me too much for this simple job.
Back to top
View user's profile Send private message
ABCza



Joined: 03 Jun 2008
Posts: 22
Location: Italy

PostPosted: Sun Jul 06, 2008 6:28 am    Post subject: Reply with quote

I alway thought that autohotkey was not suitable for this uses. When i tried to write script using Windows API i alway incurred in particular problems.

Therefore the solutions that you and other historical member offer to us are incredible. Now i have to read a big thread Very Happy

Thank you for the quick reply!
_________________
ABCza
Back to top
View user's profile Send private message MSN Messenger
Kudos



Joined: 21 Aug 2006
Posts: 20

PostPosted: Mon Jul 07, 2008 7:07 pm    Post subject: Right Click Drag Reply with quote

This is a very nice script thanks!

Has no one noticed that it breaks your right-click drag in all applications, such as Windows Explorer / Directory Opus?

I changed it so it doesn't block the right mouse click:

Code:

#Z::WinTraymin()
~RButton:: ;don't block the right click
If   h:=WM_NCHITTEST()
   WinTraymin(0,h)
;Else   Send, {RButton}
Return
Back to top
View user's profile Send private message
ABCza



Joined: 03 Jun 2008
Posts: 22
Location: Italy

PostPosted: Mon Jul 07, 2008 9:32 pm    Post subject: Reply with quote

This is two little "defects" i noticed using it in Windows Vista (i can't reproduce this behaviour in XP now):

1) Only lower half of the minimize button is right-clickable.

2) When a window is minimized, right clicking the tray icon of that window, the default AHK menu is shown and the window is unminimized. The second time you minimize that window, the menu isn't shown. This behaviour is strange, because sometimes the menu is shown more than 1 times, because the window is unminimized but the tray icon is locked until the window is minimized one more time.
_________________
ABCza
Back to top
View user's profile Send private message MSN Messenger
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Tue Jul 08, 2008 2:18 am    Post subject: Re: Right Click Drag Reply with quote

Kudos wrote:
Code:
~RButton:: ;don't block the right click

It can bring up the SYSMENU, so better change the hotkey itself if encounter a conflict with other ones.
BTW, you can simulate all right-drag features with left-drag:
Move: left-drag with pressing Shift, Copy: left-drag with pressing Ctrl, Link: left-drag with pressing Shift&Ctrl (:Alt instead of Shift&Ctrl also works in explorer.exe in my XPSP3).


Last edited by Sean on Tue Jul 08, 2008 9:41 am; edited 1 time in total
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Tue Jul 08, 2008 2:29 am    Post subject: Reply with quote

ABCza wrote:
1) Only lower half of the minimize button is right-clickable.
I have no idea why so in Vista, I have never used Vista.

Quote:
When a window is minimized, right clicking the tray icon of that window, the default AHK menu is shown and the window is unminimized. The second time you minimize that window, the menu isn't shown. This behaviour is strange, because sometimes the menu is shown more than 1 times, because the window is unminimized but the tray icon is locked until the window is minimized one more time.

Haven't you experienced any problem with Left/Middle click? And which tryicon was at the right of the icon you clicked, possibly AHK's own trayicon?

Anyway, I uploaded new one in the same link. The change is that the hotkey is changed to RButton Up, and restoring the tray-minimized window is changed to LButton/MButton Down and RButton Up.

PS. If the behavior is still not corrected, you may change the Message ID from 1028 to any other unused one, e.g., possibly 32767. I deliberately used AHK's trayicon Message ID 1028 to allow assigning RButton to bring up custom Tray Menu.


Last edited by Sean on Tue Jul 08, 2008 2:46 am; edited 1 time in total
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Jul 08, 2008 2:44 am    Post subject: Reply with quote

Sean wrote:
ABCza wrote:
1) Only lower half of the minimize button is right-clickable.
I have no idea why so in Vista, I have never used Vista.

Quote:
When a window is minimized, right clicking the tray icon of that window, the default AHK menu is shown and the window is unminimized. The second time you minimize that window, the menu isn't shown. This behaviour is strange, because sometimes the menu is shown more than 1 times, because the window is unminimized but the tray icon is locked until the window is minimized one more time.

Haven't you experienced any problem with Left/Middle click? And which tryicon was at the right of the icon you clicked, possibly AHK's own trayicon?

Anyway, I uploaded new one in the same link. The change is that the hotkey is changed to RButton Up, and restoring the tray-minimized window is changed to LButton/MButton Down and RButton Up.


PS. If the behavior is still not corrected, you may change the Message ID from 1028 to any other unused one, e.g., possibly 32767. I deliberately used AHK's trayicon Message ID 1028 to allow assigning RButton to bring up custom Tray Menu.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Tue Jul 08, 2008 2:47 am    Post subject: Reply with quote

The above post by Guest was by me, by accident. So, please ignore it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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