AutoHotkey Community

It is currently May 26th, 2012, 11:41 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 17th, 2008, 9:31 pm 
Offline

Joined: November 17th, 2008, 9:07 pm
Posts: 1
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2008, 9:47 pm 
Offline

Joined: February 11th, 2005, 6:31 am
Posts: 174
Location: Germany
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 )
}




Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2008, 10:34 pm 
Offline

Joined: March 21st, 2005, 6:37 pm
Posts: 117
Location: Bahia, Brasil
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2008, 10:59 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
.. and more : Automating Windows Explorer posted by MisterW

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher and 22 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