Making Quick Access Popup TC compatible
Moderators: Hacker, petermad, Stefan2, white
Making Quick Access Popup TC compatible
I'm the developer of Folders Popup, a folders launcher used in Windows Explorer and file dialog boxes, but also with various Explorer replacement software and addons. In a few words, when FP is running, you can press the Middle-Mouse button to move to one of your favorite folders. It works under Win XP, 7, 8 and 8.1.
Several TC users asked to add TC support in Folders Popup (FP). I'm now ready to do it but I'll need some help from TC experts here to find the best way to achieve this integration.
Here are the types of interaction I need to develop between FP and TC:
1) Recognize when the active window (or window under the mouse) is a TC lister (required to enable FP popup menu on these windows).
2) Change the folder in the active file list.
3) Open a new TC window in a given folder.
4) Copy the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
5) Open special folders (Desktop, Documents, Pictures, My Computer, Network Neighborhood, Control Panel and Recycle Bin) in the current or in a new TC window.
6) Get a list of all folders opened in all TC file lists.
As much as possible, this would be done by accessing internal TC commands, if available. If not, FP can send keystrokes or mouse clicks to TC. Keystrokes are, of course, more reliable. However, user that change his keyboard layout would break FP integration. Also, commands must work with any localized version of TC and of Windows.
I'll follow-up in the next post with my early findings.
(EDIT 2016-08-14: thread title changed from "Folders Popup" to "Quick Access Popup")
Several TC users asked to add TC support in Folders Popup (FP). I'm now ready to do it but I'll need some help from TC experts here to find the best way to achieve this integration.
Here are the types of interaction I need to develop between FP and TC:
1) Recognize when the active window (or window under the mouse) is a TC lister (required to enable FP popup menu on these windows).
2) Change the folder in the active file list.
3) Open a new TC window in a given folder.
4) Copy the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
5) Open special folders (Desktop, Documents, Pictures, My Computer, Network Neighborhood, Control Panel and Recycle Bin) in the current or in a new TC window.
6) Get a list of all folders opened in all TC file lists.
As much as possible, this would be done by accessing internal TC commands, if available. If not, FP can send keystrokes or mouse clicks to TC. Keystrokes are, of course, more reliable. However, user that change his keyboard layout would break FP integration. Also, commands must work with any localized version of TC and of Windows.
I'll follow-up in the next post with my early findings.
(EDIT 2016-08-14: thread title changed from "Folders Popup" to "Quick Access Popup")
Last edited by JnLLnd on 2016-08-14, 13:35 UTC, edited 1 time in total.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
Here are the progress on some points:
1) Recognize when the active window (or window under the mouse) is a TC lister (required to enable FP popup menu on these windows).
SOLVED: window class is "TTOTAL_CMD".
2) Change the folder in the active file list.
Is there a "Go" key? I tried Ctrl-Down (set focus to the command line), type (paste) the folder and {Enter}. But it opens the folder in an Explorer window.
3) Open a new TC window in a given folder.
SOLVED: run the command "C:\totalcmd\TOTALCMD64.EXE c:\temp" (user would have to provide the path to TOTALCMD64.EXE in the FP config).
4) Copy the the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
Ctrl-Y to set focus to the command line and erase its content, Ctrl-P to paste the current path in the command line. Now I need to select the cmd line content (Ctrl-A does not select cmd line content) and copy it to the clipboard.
5) Open special folders (Desktop, Documents, Pictures, My Computer, Network Neighborhood, Control Panel and Recycle Bin) in the current or in a new TC window.
I'm OK with Desktop, Documents, Pictures: I know these paths and just need a solution to 2). The other are more challenging: My Computer, Network Neighborhood, Control Panel and Recycle Bin. For these destinations, I use an internal command with Explorer.
6) Get a list of all folders opened in all TC file lists.
No idea...
Thanks for your input on this!
1) Recognize when the active window (or window under the mouse) is a TC lister (required to enable FP popup menu on these windows).
SOLVED: window class is "TTOTAL_CMD".
2) Change the folder in the active file list.
Is there a "Go" key? I tried Ctrl-Down (set focus to the command line), type (paste) the folder and {Enter}. But it opens the folder in an Explorer window.
3) Open a new TC window in a given folder.
SOLVED: run the command "C:\totalcmd\TOTALCMD64.EXE c:\temp" (user would have to provide the path to TOTALCMD64.EXE in the FP config).
4) Copy the the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
Ctrl-Y to set focus to the command line and erase its content, Ctrl-P to paste the current path in the command line. Now I need to select the cmd line content (Ctrl-A does not select cmd line content) and copy it to the clipboard.
5) Open special folders (Desktop, Documents, Pictures, My Computer, Network Neighborhood, Control Panel and Recycle Bin) in the current or in a new TC window.
I'm OK with Desktop, Documents, Pictures: I know these paths and just need a solution to 2). The other are more challenging: My Computer, Network Neighborhood, Control Panel and Recycle Bin. For these destinations, I use an internal command with Explorer.
6) Get a list of all folders opened in all TC file lists.
No idea...
Thanks for your input on this!
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
Forgot to mention that FP is written in AutoHotkey (AKH v1.1).
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
I strongly recommend to use internal TC commands cm_* to solve some of your issues. That's much better than to "control" TC's GUI, which depends on the user's settings and is subject to change in every new version (TC's cm_* commands are not).
You can get the list of internal commands by
Regards
Dalai
You can get the list of internal commands by
- typing "cm_CommandBrowser" in TC's command line
- using the magnifying glass in several places (changing a button of the buttonbar, assigning hotkeys in TC's settings and so on).
Not quite. The executable of TC 32 bit is TOTALCMD.exe. Or it might even be renamed to explorer.exe because some crappy antivirus software enables its shell extension only in explorer.exe process (e.g. Norton).3) Open a new TC window in a given folder.
SOLVED: run the command "C:\totalcmd\TOTALCMD64.EXE c:\temp" (user would have to provide the path to TOTALCMD64.EXE in the FP config).
Type "CD " before the path. But remember that TC's command line can be hidden via options, or even disabled via RestrictInterface! So that's not as easy as it might seem.2) Change the folder in the active file list.
Is there a "Go" key? I tried Ctrl-Down (set focus to the command line), type (paste) the folder and {Enter}. But it opens the folder in an Explorer window.
Here you can easily use cm_CopySrcPathToClip. However, it would be better to not modify/overwrite the clipboard's content unless the user knows that this will happen. What I'm trying to say: maybe there's a better way to get the path into your software, without modifying the clipboard (because it's the user's clipboard, not that of any program).4) Copy the the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
Regards
Dalai
Last edited by Dalai on 2014-10-01, 14:36 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
You need the switch /o as parameter to use the current TC instanceJnLLnd wrote:Here are the progress on some points:
3) Open a new TC window in a given folder.
SOLVED: run the command "C:\totalcmd\TOTALCMD64.EXE c:\temp" (user would have to provide the path to TOTALCMD64.EXE in the FP config).
Thanks for your input on this!
Also the user may want to add /t for tabs.
Better solution is to let the user provide the full TC command line including any parameters and you provide some varaiable to insert for the folder path.
Thank you Dalai and Horst.Epp for your quick replies. I'll come back to you tonight (Montreal time).
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
JnLLnd,
If your program is started by TC, you can use the %COMMANDER_EXE% environment variable.
Opens a new window.
Opens a new tab.
HTH
Roman
Help - 4.a)2) Change the folder in the active file list.
Code: Select all
totalcmd[64].exe /O /S "/L=c:\path\to\open"
3) Open a new TC window in a given folder.
Code: Select all
totalcmd[64].exe /N /S "/L=c:\path\to\open"
Code: Select all
totalcmd[64].exe /O /S /T "/L=c:\path\to\open"
4) Copy the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
Code: Select all
WinGetText, TCWindowText, ahk_class TTOTAL_CMD
RegExMatch(TCWindowText, "\n(.*)>", TCPath)
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
- franck8244
- Power Member
- Posts: 704
- Joined: 2003-03-06, 17:37 UTC
- Location: Geneva...
I wrote a TC interaction test tool in ahk v1.1 a few month ago
Implementing all tc -method- (internal tc command / user command / external via copydata)
I organized all in a few ahk classes , if you are interested there's a Link
Implementing all tc -method- (internal tc command / user command / external via copydata)
I organized all in a few ahk classes , if you are interested there's a Link
TC#88260 -
Thank you all for all these useful insights! This forum works quite well 
I agree that this approach is more reliable than interacting with the Gui.
And, again, thank you all.

Yes. This (and the other examples you provide) is exactly what I need. I understand that /S will make sure the /L is applied to the "active" pane (regardless of its left-right side). This will also work on any active tab.Hacker wrote:Help - 4.a)
totalcmd[64].exe /O /S "/L=c:\path\to\open"
As it is, this does not work (TCPath is empty). Maybe a typo? I'm not a RegEx expert but I made this work by removing the \n. I also stripped the last char.Hacker wrote:WinGetText, TCWindowText, ahk_class TTOTAL_CMD
RegExMatch(TCWindowText, "\n(.*)>", TCPath)
Code: Select all
RegExMatch(TCWindowText, "(.*)>", TCPath)
StringTrimRight, TCPath, TCPath, 1
MsgBox, !%TCPath%! ; WORKS
The list of commands is impressive! Is it possible to invoke these commands from the command line? For example, to open the list if drives in the current pane (not working example): "totalcmd[64].exe /O /S /cm_OpenDrives".Dalai wrote:I strongly recommend to use internal TC commands cm_* to solve some of your issues
Interesting. But, here again, how would I invoke this from the command line?Dalai wrote:Here you can easily use cm_CopySrcPathToClip.4) Copy the the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
I agree with you. I use the clipboard only if there is no better way to exchange info with a running program and I always backup and restore the user's clipboard when I have to do this.Dalai wrote:maybe there's a better way to get the path into your software, without modifying the clipboard (because it's the user's clipboard, not that of any program
Good points. Noted.Horst.Epp wrote:You need the switch /o as parameter to use the current TC instance
Also the user may want to add /t for tabs.
Better solution is to let the user provide the full TC command line including any parameters and you provide some varaiable to insert for the folder path.
Hummm. Looks like good stuff. I'll dig it. Thanks for sharing.franck8244 wrote:I wrote a TC interaction test tool in ahk v1.1 a few month ago
Implementing all tc -method- (internal tc command / user command / external via copydata)
I organized all in a few ahk classes , if you are interested there's a Link
And, again, thank you all.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Please read the following Wiki page for instructions on how to control TC from AutoHotkey:Forgot to mention that FP is written in AutoHotkey (AKH v1.1).
http://www.ghisler.ch/wiki/index.php/AutoHotkey
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
You must send the cm_ command to the TC window. I don't know if there is a SendMessage function (or equivalent) in AHK but it works in Delphi and AutoIt. So you kind of have to interact with the GUI but not in a visible way.JnLLnd wrote:The list of commands is impressive! Is it possible to invoke these commands from the command line? For example, to open the list if drives in the current pane (not working example): "totalcmd[64].exe /O /S /cm_OpenDrives".Dalai wrote:I strongly recommend to use internal TC commands cm_* to solve some of your issues
AutoIt example:
Code: Select all
#Include <SendMessage.au3>
#Include <WindowsConstants.au3>
global const $CM_COMMANDBROWSER = 2924
global const $TOTALCMDMSG = $WM_USER + 51
$hnd = WinGetHandle("[CLASS:TTOTAL_CMD]")
if $hnd > 0 then
_SendMessage($hnd, $TOTALCMDMSG , $CM_COMMANDBROWSER, 0)
EndIf
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Great resource!ghisler(Author) wrote:Please read the following Wiki page for instructions on how to control TC from AutoHotkey:
http://www.ghisler.ch/wiki/index.php/AutoHotkey
Yes it does. An example from the wiki mentioned by Ghisler here: http://www.ghisler.ch/wiki/index.php/AutoHotkey:_Send_a_command_to_Total_CommanderDalai wrote:You must send the cm_ command to the TC window. I don't know if there is a SendMessage function (or equivalent) in AHK but it works in Delphi and AutoIt. So you kind of have to interact with the GUI but not in a visible way.
Thanks.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
So far, so good for items 1-5:
1) Recognize when the active window (or window under the mouse) is a TC lister (required to enable FP popup menu on these windows).
SOLVED: window class is "TTOTAL_CMD".
2) Change the folder in the active file list.
3) Open a new TC window in a given folder.
4) Copy the the path of the folder in the active file list to the clipboard (to easily add this folder to the popup menu).
5) Open special folders (Desktop, Documents, Pictures, My Computer, Network Neighborhood, Control Panel and Recycle Bin) in the current or in a new TC window.
6) Get a list of all folders opened in all TC file lists.
No solution at this time. WinGetText returns only the path of the active list/tab. Any other idea?
Thank you all for your input.
1) Recognize when the active window (or window under the mouse) is a TC lister (required to enable FP popup menu on these windows).
SOLVED: window class is "TTOTAL_CMD".
2) Change the folder in the active file list.
Code: Select all
; look for the TC path in HKEY_CURRENT_USER\Software\Ghisler\Total Commander\InstallDir or HKEY_LOCAL_MACHINE\Software\Ghisler\Total Commander\InstallDir
; test that totalcmd64.exe or totalcmd.exe exists
run, C:\totalcmd\TOTALCMD64.EXE /O /S "/L=c:\temp\" ; /O existing file list, /S source-dest /L=source (active pane) - change folder in the active pane/tab
Code: Select all
run, C:\totalcmd\TOTALCMD64.EXE /N "/L=c:\temp\" ; /N existing file list, /L= left pane of the new window
Code: Select all
; backup clipboard
cm_CopySrcPathToClip := 2029
SendMessage, 0x433, %cm_CopySrcPathToClip%, , , ahk_class TTOTAL_CMD
; restore clipboard
Code: Select all
cm_OpenDesktop := 2121
cm_OpenDrives := 2122
cm_OpenControls := 2123
cm_OpenNetwork := 2125
cm_OpenRecycled := 2127
SendMessage, 0x433, %cm_OpenDesktop%, , , ahk_class TTOTAL_CMD ;
SendMessage, 0x433, %cm_OpenDrives%, , , ahk_class TTOTAL_CMD ;
SendMessage, 0x433, %cm_OpenControls%, , , ahk_class TTOTAL_CMD ;
SendMessage, 0x433, %cm_OpenNetwork%, , , ahk_class TTOTAL_CMD ;
SendMessage, 0x433, %cm_OpenRecycled%, , , ahk_class TTOTAL_CMD ;
No solution at this time. WinGetText returns only the path of the active list/tab. Any other idea?
Thank you all for your input.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
JnLLnd,
Or you can use a perhaps more "correct" code using look-behind and look-ahead assertions:
Then you can use TCPath as is.
HTH
Roman
Ah yes, sorry, you must access the subpattern using TCPath1 as in Send, %TCPath1%.As it is, this does not work (TCPath is empty). Maybe a typo? I'm not a RegEx expert but I made this work by removing the \n. I also stripped the last char.Hacker wrote:WinGetText, TCWindowText, ahk_class TTOTAL_CMD
RegExMatch(TCWindowText, "\n(.*)>", TCPath)
Or you can use a perhaps more "correct" code using look-behind and look-ahead assertions:
Code: Select all
WinGetText, TCWindowText, ahk_class TTOTAL_CMD
RegExMatch(TCWindowText, "(?<=\n).*(?=>)", TCPath)
Try looking at <AddOn> Update: MultiCopy to TAB v5.8/25 Sep 2010. No idea if the source is included, though.6) Get a list of all folders opened in all TC file lists.
No solution at this time. WinGetText returns only the path of the active list/tab. Any other idea?
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
I found no source file. But thanks for the info.Hacker wrote:Try looking at <AddOn> Update: MultiCopy to TAB v5.8/25 Sep 2010. No idea if the source is included, though.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca