| View previous topic :: View next topic |
| Author |
Message |
user
Joined: 05 Oct 2006 Posts: 423
|
Posted: Sat Mar 22, 2008 12:50 pm Post subject: create new folder script |
|
|
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 |
|
| Back to top |
|
 |
user
Joined: 05 Oct 2006 Posts: 423
|
Posted: Fri Mar 28, 2008 2:24 am Post subject: |
|
|
| anyone? |
|
| Back to top |
|
 |
System Monitor
Joined: 09 Mar 2007 Posts: 392 Location: Unknown
|
Posted: Fri Mar 28, 2008 2:29 am Post subject: |
|
|
You could change the hotkey to something like Win-n _________________
 |
|
| Back to top |
|
 |
user
Joined: 05 Oct 2006 Posts: 423
|
Posted: Sat Mar 29, 2008 12:13 am Post subject: |
|
|
| System Monitor wrote: | | You could change the hotkey to something like Win-n |
not intended |
|
| Back to top |
|
 |
HuBa
Joined: 24 Feb 2007 Posts: 172 Location: Budapest, Hungary
|
Posted: Sat Mar 29, 2008 2:21 am Post subject: |
|
|
Check if the SysListView321 has the focus with ControlGetFocus.
And check if the mouse cursor is within the boundaries of the SysListView321 with MouseGetPos. |
|
| Back to top |
|
 |
user
Joined: 05 Oct 2006 Posts: 423
|
Posted: Sat Mar 29, 2008 2:56 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Apr 03, 2008 3:17 am Post subject: |
|
|
| move the MouseGetPos line and the ControlGet line after the if statement so they only get called on the first click |
|
| Back to top |
|
 |
|