 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
sherwin
Joined: 17 Nov 2008 Posts: 1
|
Posted: Mon Nov 17, 2008 8:31 pm Post subject: Explorer Post Message (Sort By modified, size, name, etc) |
|
|
Hello, I'm trying to create hotkeys for frequent explorer commands such as "sort by date modified". Now, I already know it's possible by sending keystrokes, like
| Code: | #ifwinactive, ahk_class CabinetWClass
#1:: send, !von{enter} |
would sort by name (view, sort, name)
However, this is unreliable. I want to do this via post message or send message or winmenuselect; so far I've had no luck. Oh, I'm running Vista, btw.
I've checked the tutorial using winspector spy here: http://www.autohotkey.com/docs/misc/SendMessage.htm I tried winspector spy, but the problem is that I don't see any messages generated by the explorer window after I select an explorer window with the crosshair.
So postmessage wasn't possible, as I couldn't obtain the message code.
Then I turned to winmenuselectitem
| Code: | #ifwinactive ahk_class CabinetWClass
!1::
WinMenuSelectItem , ahk_class CabinetWClass, , View, Details ;
MsgBox hello
return |
And when I do this, I get the message box that says hello, but the view does not change at all (to details).
However, I did get winmenuselectitem to with select all for notepad and mspaint:
| Code: |
!5::
SetTitleMatchMode 2
WinMenuSelectItem, A, , Edit, Select All
return
|
So it seems that Vista's explorer just doesn't react to winmenuselectitem, where as older programs (notepad and mspaint) both do.
Do you guys have any way to resolve this barrier? |
|
| Back to top |
|
 |
Andi
Joined: 11 Feb 2005 Posts: 173 Location: Germany
|
Posted: Mon Nov 17, 2008 8:47 pm Post subject: |
|
|
Somewhere I've found this code, which shows the details in Explorer or a file dialog. But I'm also still searching for a way to sort by date...
| Code: | #f7::
;ViewDetails
WinGet, eh_activeID, ID, A
eh_SHELLDLL_DefView := eh_func_FindWindowEx( eh_activeID, 0, "SHELLDLL_DefView", 0 )
If eh_SHELLDLL_DefView > 0
PostMessage, 0x111, 28716,,, ahk_id %eh_SHELLDLL_DefView% ; Details
Return
; -----------------------------------------------------------------------------
; === Subroutines =============================================================
; -----------------------------------------------------------------------------
;FindWindowEx, die Sie auf Basis des Elternfensters von hDialog nach einem Kindfenster
;suchen lassen, das den Klassennamen "SHELLDLL_DefView" trägt. Ist diese Information ermittelt,
;steht einer Umschaltung der Dateiansicht beim Aufruf der "Öffnen"- und "Speichern"-Dialoge nichts mehr im Wege:
eh_func_FindWindowEx( p_hw_parent, p_hw_child, p_class, p_title ) {
if ( p_title = 0 )
type_title = uint
else
type_title = str
return, DllCall( "FindWindowEx"
, "uint", p_hw_parent
, "uint", p_hw_child
, "str", p_class
, type_title, p_title )
}
|
|
|
| Back to top |
|
 |
enrica
Joined: 21 Mar 2005 Posts: 117 Location: Bahia, Brasil
|
Posted: Mon Nov 17, 2008 9:34 pm Post subject: |
|
|
this? | Code: | PostMessage, 0x111, 28715,,, ahk_class CabinetWClass ; List
PostMessage, 0x111, 28716,,, ahk_class CabinetWClass ; Details
PostMessage, 0x111, 28717,,, ahk_class CabinetWClass ; Thumbnails
PostMessage, 0x111, 30210,,, ahk_class CabinetWClass ; Name
PostMessage, 0x111, 30211,,, ahk_class CabinetWClass ; Size
PostMessage, 0x111, 30212,,, ahk_class CabinetWClass ; Type
PostMessage, 0x111, 30213,,, ahk_class CabinetWClass ; Date modified |
_________________ 65.6E.72.69.63.61. (My hovercraft is full of eels) |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Mon Nov 17, 2008 9:59 pm Post subject: |
|
|
.. and more : Automating Windows Explorer posted by MisterW _________________ URLGet - Internet Explorer based Downloader |
|
| 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
|