 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
savage
Joined: 02 Jul 2004 Posts: 206
|
Posted: Thu Aug 19, 2004 2:03 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 206
|
Posted: Thu Aug 19, 2004 2:28 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Aug 19, 2004 9:07 am Post subject: |
|
|
| 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). |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 206
|
Posted: Sat Aug 21, 2004 1:06 am Post subject: |
|
|
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* |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
|
| Back to top |
|
 |
Tekl Guest
|
Posted: Fri Sep 24, 2004 2:55 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
|
| Back to top |
|
 |
Sandeep Guest
|
Posted: Thu Sep 30, 2004 1:29 pm Post subject: |
|
|
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! |
|
| Back to top |
|
 |
Sandeep Guest
|
Posted: Fri Oct 01, 2004 2:57 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 206
|
Posted: Sun Oct 03, 2004 5:19 pm Post subject: |
|
|
| Figures they don't use their own standard dialogs in Office. Sheesh. |
|
| Back to top |
|
 |
Nemroth
Joined: 07 Sep 2004 Posts: 262 Location: France
|
Posted: Sun Oct 03, 2004 6:59 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Tue Oct 05, 2004 7:46 am Post subject: |
|
|
Hi Nemroth,
do you have visible the Pathbox (Ctrl+Shift+D)?
Tekl |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Oct 05, 2004 5:56 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Nemroth
Joined: 07 Sep 2004 Posts: 262 Location: France
|
Posted: Tue Oct 05, 2004 6:02 pm Post subject: |
|
|
| Sorry I was disconected and I forgot to Log in after. The message before this one was mine. |
|
| 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
|