AutoHotkey Community

It is currently May 27th, 2012, 1:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: August 19th, 2004, 2:03 am 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
I started actually using this script and I really love it. Stuck it on my 5th mouse button. Now I'm poking around with the idea of making a clip-list that combines a general list of clips with application-specific ones. Could be nice.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2004, 2:28 am 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
I just found out that the explorer window ones work even if the address bar is disabled. I'd say the control is still there, just hidden.

And I don't get the two classes thing for explorer either. If I run explorer and it comes up without a folders pane, it's cabinetwclass. If I run it and it does it's explorerwclass, but if I turn on the folders pane in cabinetwclass, it doesn't change to explorerwclass, and vice versa. What's the point of having to classes?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2004, 9:07 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Quote:
the explorer window ones work even if the address bar is disabled. I'd say the control is still there, just hidden.

Yes but it's a trick: It only works if you've just freshly disabled the address bar. If you launch a window and it lacks an address bar, the control does not seem to exist (at least on my system).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2004, 1:06 am 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
Oh, how stupid. It doesn't matter to me, as much, seeing as I don't use explorer. I use Directory Opus, the world's finest windows file manager!

*accepts bag of money*


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 25th, 2004, 1:15 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I've published Savage's wonderful script to the web site. It's at http://www.autohotkey.com/docs/scripts/ ... olders.htm

I've made a few additional minor improvements and added instructions and comments.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2004, 2:55 pm 
Hi,

I added the following to support AcdSee 3.1:

else if f_class = Afx:400000:0
{
if f_Edit1Pos <>
{
ControlSetText, Edit1, %f_path%, ahk_id %f_window_id%
ControlSend, Edit1, {Enter}, ahk_id %f_window_id%
return
}
}

I also changed:
if f_class in #32770,ExploreWClass,CabinetWClass,Afx:400000:0

Tekl


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2004, 3:57 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
http://www.softpedia.com/public/cat/9/2/9-2-17.shtml

yours?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2004, 6:40 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The menus it creates have icons inside them. Someday I hope AutoHotkey will have this feature too (it's been requested):

http://www.nabocorp.com/myfolders/index.php


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2004, 1:29 pm 
It didn't work in Office 2003 had to make some changes in f_DisplayMenu

Code:
;----Display the menu
f_DisplayMenu:
; These first few variables are set here and used by f_OpenFavorite:
WinGet, f_window_id, ID, A
WinGetClass, f_class, ahk_id %f_window_id%
if f_class contains #32770,ExploreWClass,CabinetWClass,bosa_sdm  ; Dialog or Explorer.
   ControlGetPos, f_Edit1Pos,,,, Edit1, ahk_id %f_window_id%
if f_AlwaysShowMenu = n  ; The menu should be shown only selectively.
{
   if f_class contains #32770,ExploreWClass,CabinetWClass,bosa_sdm  ; Dialog or Explorer.
   {
      if f_Edit1Pos =  ; The control doesn't exist, but do additional check for Office 2003
      {
         ControlGetPos, f_Edit1Pos,,,, RichEdit20W2, ahk_id %f_window_id%
         if f_Edit1Pos =  ; It is not even Office 2003
            return
      }
   }
   else if f_class <> ConsoleWindowClass
      return ; Since it's some other window type, don't display menu.
}
; Otherwise, the menu should be presented for this type of window:
Menu, Favorites, show
return


They have introduced more classes to check for!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2004, 2:57 am 
Oops! The previous code solves only half the problem i.e. to display the menu.
You would need to change following two functions for the complete thing.

Code:
;----Open the selected favorite
f_OpenFavorite:
; Fetch the array element that corresponds to the selected menu item:
StringTrimLeft, f_path, f_path%A_ThisMenuItemPos%, 0
if f_path =
   return

if f_class contains #32770,bosa_sdm    ; It's a dialog.
{
   if f_Edit1Pos <>   ; And it has an Edit1 control.
   {
      ; Activate the window so that if the user is middle-clicking
      ; outside the dialog, subsequent clicks will also work:
      WinActivate ahk_id %f_window_id%
      ; Retrieve any filename that might already be in the field so
      ; that it can be restored after the switch to the new folder:
      ControlGetText, f_text, %f_EditClass%, ahk_id %f_window_id%
      ControlSetText, %f_EditClass%, %f_path%, ahk_id %f_window_id%
      ControlFocus, %f_EditClass%, ahk_id %f_window_id%
      ControlSend, %f_EditClass%, {Enter}, ahk_id %f_window_id%
      Sleep, 100  ; It needs extra time on some dialogs or in some cases.
      ControlSetText, %f_EditClass%, %f_text%, ahk_id %f_window_id%
      return
   }
   ; else fall through to the bottom of the subroutine to take standard action.
}
else if f_class in ExploreWClass,CabinetWClass  ; In Explorer, switch folders.
{
   if f_Edit1Pos <>   ; And it has an Edit1 control.
   {
      ControlSetText, %f_EditClass%, %f_path%, ahk_id %f_window_id%
      ControlSend, %f_EditClass%, {Enter}, ahk_id %f_window_id%
      return
   }
   ; else fall through to the bottom of the subroutine to take standard action.
}
else if f_class = ConsoleWindowClass ; In a console window, CD to that directory
{
   WinActivate, ahk_id %f_window_id% ; Because sometimes the mclick deactivates it.
   SetKeyDelay, 0  ; This will be in effect only for the duration of this thread.
   IfInString, f_path, :  ; It contains a drive letter
   {
      StringLeft, f_path_drive, f_path, 1
      Send %f_path_drive%:{enter}
   }
   Send, cd %f_path%{Enter}
   return
}
; Since the above didn't return, one of the following is true:
; 1) It's an unsupported window type but f_AlwaysShowMenu is y (yes).
; 2) It's a supported type but it lacks an Edit1 control to facilitate the custom
;    action, so instead do the default action below.
Run, Explorer %f_path%  ; Might work on more systems without double quotes.
return


;----Display the menu
f_DisplayMenu:
; These first few variables are set here and used by f_OpenFavorite:
WinGet, f_window_id, ID, A
WinGetClass, f_class, ahk_id %f_window_id%
f_EditClass = Edit1   ;Default
if f_class contains #32770,ExploreWClass,CabinetWClass,bosa_sdm  ; Dialog or Explorer.
{
   ControlGetPos, f_Edit1Pos,,,, %f_EditClass%, ahk_id %f_window_id%
   if f_Edit1Pos =  ; The control doesn't exist, but check for Office 2003
   {
      f_EditClass = RichEdit20W2
      ControlGetPos, f_Edit1Pos,,,, %f_EditClass%, ahk_id %f_window_id%
   }
}
if f_AlwaysShowMenu = n  ; The menu should be shown only selectively.
{
   if f_class contains #32770,ExploreWClass,CabinetWClass,bosa_sdm  ; Dialog or Explorer.
   {
      if f_Edit1Pos =  ; The control doesn't exist, so don't display the menu
         return
   }
   else if f_class <> ConsoleWindowClass
      return ; Since it's some other window type, don't display menu.
}
; Otherwise, the menu should be presented for this type of window:
Menu, Favorites, show
return


Beware of MS implementation of Open/Save dialog boxes in Office 2003 and do not click middle button while your mouse is inside that big list view. I could not improve it :(

I am sorry for the hasty post earlier.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2004, 5:19 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
Figures they don't use their own standard dialogs in Office. Sheesh.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2004, 6:59 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
Tekl wrote:
Hi,

I added the following to support AcdSee 3.1:

else if f_class = Afx:400000:0
{
if f_Edit1Pos <>
{
ControlSetText, Edit1, %f_path%, ahk_id %f_window_id%
ControlSend, Edit1, {Enter}, ahk_id %f_window_id%
return
}
}

I also changed:
if f_class in #32770,ExploreWClass,CabinetWClass,Afx:400000:0

Tekl


Hi Tekl,

I tried for an app to manage the "Afx:400000:0" type of controls but I didn't succeed. Can you send me your modified code on my pm (rather than posting : I think it's probably too long) for me too see where exactly you made your changes.
Thanks by advance
Nemroth


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2004, 7:46 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
Hi Nemroth,

do you have visible the Pathbox (Ctrl+Shift+D)?

Tekl


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2004, 5:56 pm 
Hi Tekl
I must explain myself.
I have Win98 SE, so I think I can't use File Open Favorite as it seems to be intended for XP... My purpose is (always) to retrieve the text of an Afx: type of control (you can see old topics http://www.autohotkey.com/forum/viewtopic.php?t=359&highlight=afx and http://www.autohotkey.com/forum/viewtopic.php?t=633&highlight=afx about that)
Seeing more precisely the File Open Favorite code, I tried to obtain the text in the Afx: equivalent of an edit control in SuperEdi (in witch the text to edit is displayed in an Afx: edit control) and at work in EXTRA!, from Attachmate. I used the code below :
Code:
;WinGet, OutputVar [, Cmd, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGet, SE_Win_ID, ID, SuperEdi
WinGet, SE_Win_List, ControlList, SuperEdi
WinGetClass, SE_Win_CL, ahk_id %SE_Win_ID%
msgbox %SE_Win_List%

Loop, Parse, SE_Win_List, `n
{
  ControlGetText, SE_Ctrl_Txt, %A_LoopField%, ahk_id %SE_Win_ID%
   MsgBox, 4,, The control #%a_index% is "%A_LoopField%"`nand it's text is "%SE_Ctrl_Txt%".`nContinue?
   IfMsgBox, No
      break
}
And I Fail twice. In the Afx: type of control, you only can retrieve the text of very few controls. An Afx: type of control is a control of an old Visual C++ app developped with old MFC.
I know know that I can't no more retrieve the text of an Afx: control. I believed it was now possible to access an Afx: edit control. It isn't.
Thanks for your answer.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2004, 6:02 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
Sorry I was disconected and I forgot to Log in after. The message before this one was mine.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 8 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