AutoHotkey Community

It is currently May 26th, 2012, 4:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: create new folder script
PostPosted: March 22nd, 2008, 12:50 pm 
Offline

Joined: October 5th, 2006, 8:45 am
Posts: 476
hello

this is Titan's script that creates new folder on double click:

Code:
#IfWinActive ahk_class CabinetWClass ; the ahk_class of explorer windows
; hotkeys here will only work when explorer windows are active

~LButton:: ; the left mouse button
SetKeyDelay, , 50 ; seems to be needed for SendEvent to work
MouseGetPos, , , , ctrl ; get the control under the mouse cursor
ControlGet, sel, List, Count Selected, SysListView321, A ; get the number of items selected
If DllCall("GetDoubleClickTime") > A_TimeSincePriorHotkey ; if: this is a double-click,
   and A_ThisHotkey = A_PriorHotkey ; the last hotkey pressed is the same as this one,
   and ctrl = "SysListView321" ; the control under the mouse cursor is the ListView,
   and sel = 0 ; and no items (files or folders) are selected then...
   SendEvent, !fwf ; Send Alt+F > N > F (File > New > Folder) - WinMenuSelectItem doesn't work for me
Return

#IfWinActive


the problem is that it creates new folder when you double click on the title bar of the window of a folder

specificaly, it creates it when you double click there to maximize the window and NOT when you click there to minimize the window

you may wonder why this happens... well it is because when you double click there to maximize the window, just afterwards the cursor is inside the 'listview' and thus it triggers new folder creation

on the other hand, when you double click there to minimize the window, the cursor, just afterwards, is NOT inside the listview, thus it doesn't trigger new folder creation

so what I consider to do is, either to limit the script to work when I double click on 'white' area (as well as when I click in listview area), since the title bar is blue

or there would be a better way?

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2008, 2:24 am 
Offline

Joined: October 5th, 2006, 8:45 am
Posts: 476
anyone?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2008, 2:29 am 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
You could change the hotkey to something like Win-n


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2008, 12:13 am 
Offline

Joined: October 5th, 2006, 8:45 am
Posts: 476
System Monitor wrote:
You could change the hotkey to something like Win-n


not intended


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2008, 2:21 am 
Offline

Joined: February 24th, 2007, 6:02 pm
Posts: 175
Location: Budapest, Hungary
Check if the SysListView321 has the focus with ControlGetFocus.

And check if the mouse cursor is within the boundaries of the SysListView321 with MouseGetPos.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2008, 2:56 am 
Offline

Joined: October 5th, 2006, 8:45 am
Posts: 476
HuBa wrote:
Check if the SysListView321 has the focus with ControlGetFocus.

And check if the mouse cursor is within the boundaries of the SysListView321 with MouseGetPos.


it already does both

what it needs to be done is to check these at the time of the first click AND at the time of the second click, because now it only checks them at the time of the second click


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2008, 3:17 am 
move the MouseGetPos line and the ControlGet line after the if statement so they only get called on the first click


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group