Making Quick Access Popup TC compatible

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Dalai
Power Member
Power Member
Posts: 9423
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

hi5 wrote:Just to note: if you have tabs open and close TC the tabs are also saved, so in fact there isn't much difference
That's not necessarily true. You can disable the option to save open tabs on TC's exit (Operation > Save on exit > Directories). BTW, I've always had this option disabled. So the user expressed to not save any directories and tabs - and I don't expect any other program to interfere with this. Even if it's explained why this would have to be done, I expect user's complaints about that...

If there were a command SAVETABS (as opposed to OPENTABS and APPENDTABS) this would be an easy task.

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
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 »

@Dalai: Agreed on SAVETABS - probably an easy addition to make for a future TC version. As JnLLnd has received requests from TC users I still say make it optional and leave it to the TC user to decide - start with opt-out by default. I would opt-in and you would opt-out and we'd both be happy.

@JnLLnd: re 2 - you can also use a more advanced technique to change directories in TC using WM_COPYData - see this thread http://ghisler.ch/board/viewtopic.php?t=32658#236499.
User avatar
JnLLnd
Junior Member
Junior Member
Posts: 53
Joined: 2014-10-01, 12:14 UTC
Location: Montreal, Canada
Contact:

Post by *JnLLnd »

I think the best would be to have this SAVETABS command. I added it to the Ghisler's wish list:
http://www.ghisler.ch/board/viewtopic.php?p=289074

In the mean time, I already have a lot of material to start working on the FP/TC integration. I'll let you know when it is ready if you accept to join the beta tests.

Thank you all.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 »

Just for fun - not saying it has practical use - you can get a list of all open tabs by cycling through them all using sendmessages. Example: make sure you have several tabs open in the LEFT panel - the script below will try to read the number of tabs, then simply cycle through all open tabs, store the path and restore the original active tab.

Code: Select all

; cm_LeftActivateTab1=5201

SendMessage, 0x1304,,, TMyTabControl1, ahk_class TTOTAL_CMD  ; 0x1304 is TCM_GETITEMCOUNT. 
TabCount = %ErrorLevel% ; if there are no TABs this will be FAIL
MsgBox % TabCount
If (TabCount <> "FAIL")
	{
	 ControlGet, WhichTab, Tab, , TMyTabControl1, ahk_class TTOTAL_CMD
	 Loop, % TabCount
	 	{
		 ActivateTab:=5200 + A_Index
		 SendMessage, 0x433, %ActivateTab%, , , ahk_class TTOTAL_CMD
		 ControlGetText, OutputVar, TPathPanel1, ahk_class TTOTAL_CMD
		 TabPaths .= SubStr(OutputVar,1,InStr(OutputVar,"\",false,0)) "`n"
	 	}
	 ActivateTab:=5200 + WhichTab ; restore original tab
	 SendMessage, 0x433, %ActivateTab%, , , ahk_class TTOTAL_CMD
	} 

MsgBox % TabPaths
User avatar
JnLLnd
Junior Member
Junior Member
Posts: 53
Joined: 2014-10-01, 12:14 UTC
Location: Montreal, Canada
Contact:

Post by *JnLLnd »

hi5 wrote:Just for fun - not saying it has practical use - you can get a list of all open tabs by cycling through them all using sendmessages.
Interesting. But when I run it (with 3 tabs on left side) SendMessage returns "FAIL". Using Window Spy, I can't find the TMyTabControl1 control in the TC window.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 »

Sorry, forgot to add it is for 32-bit TC, 64-bit has different classes. The Window Spy isn't very good (imho) - if you download (the portable) AutoIt you can find Au3Info.exe which is much better (can't believe I'm saying this) and then you will see the TMyTabControl1 and TMyTabControl2 when you hover your mouse over these controls (32-bit, for 64-bit it is SysTabControl321). For 64-bit try this

Code: Select all

SendMessage, 0x1304,,, SysTabControl321, ahk_class TTOTAL_CMD  ; 0x1304 is TCM_GETITEMCOUNT.
TabCount = %ErrorLevel% ; if there are no TABs this will be FAIL
MsgBox % TabCount
If (TabCount <> "FAIL")
	{
	 ControlGet, WhichTab, Tab, , SysTabControl321, ahk_class TTOTAL_CMD
	 Loop, % TabCount
	 	{
		 ActivateTab:=5200 + A_Index
		 SendMessage, 0x433, %ActivateTab%, , , ahk_class TTOTAL_CMD
		 ControlGetText, OutputVar, Window11, ahk_class TTOTAL_CMD
		 TabPaths .= SubStr(OutputVar,1,InStr(OutputVar,"\",false,0)) "`n"
	 	}
	 ActivateTab:=5200 + WhichTab ; restore original tab
	 SendMessage, 0x433, %ActivateTab%, , , ahk_class TTOTAL_CMD
	} 

MsgBox % TabPaths
User avatar
Hacker
Moderator
Moderator
Posts: 13081
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

hi5,
The Window Spy isn't very good (imho) - if you download (the portable) AutoIt you can find Au3Info.exe which is much better
What's the difference between those two? I never found any.

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.
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 »

@Hacker: the AU3_Spy.exe that has come with AHK since the beginning was never changed afaik. The newer Au3Info.exe that comes with recent AutoIt versions shows the class names of the control under the mouse more accurately. Try it with the TAB controls in TC, you won't see it with AU3_Spy.exe but you will with Au3Info.exe or other Window Spy tools (WinCheat by Alin Constantin for example) - it also has a nice "finder" where you can drag a cross-hair over a control which then gets a highlighted border around it which is a nice addition. I don't use AutoIt - I only borrow(ed) the newer spy.
User avatar
JnLLnd
Junior Member
Junior Member
Posts: 53
Joined: 2014-10-01, 12:14 UTC
Location: Montreal, Canada
Contact:

Post by *JnLLnd »

Yes, I was using an old script included with AHK. In the latest AU3 package, this tool is now named Au3Info.exe (or Au3Info_x64.exe) and it shows more info. Thanks for the tip.

About your script, thanks again. But I had to change the class name (in the loop) from "Window11" to "Window9" to make it work. I'm not sure this approach is totally reliable if class name change from one version to the other (or between the 32-bit and 64-bit). I'd certainly prefer an internal command :-)
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
User avatar
Hacker
Moderator
Moderator
Posts: 13081
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

hi5,
The only difference I see is that the AHK version shows the panel class name for the left half of the tab control for some reason, otherwise they seem to show the same info. Is there any other difference I am missing?

JnLLnd,
As far as I know those class names (well, their numbers, as in Window9 vs Window11) are dynamically generated by AHK for the given window. Not 100% sure though.

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.
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 »

@Hacker: Under Win 7 and 8 pressing Shift+Alt+Tab doesn't freeze the program (you can freeze it but it has be fiddly to do so) the other Spy's shortcut to freeze does work and it gives more info (style, handle) overall presentation is better and as you've noticed it "sees" a bit more in TC.
User avatar
Hacker
Moderator
Moderator
Posts: 13081
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

hi5,
Danke. :)

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.
User avatar
JnLLnd
Junior Member
Junior Member
Posts: 53
Joined: 2014-10-01, 12:14 UTC
Location: Montreal, Canada
Contact:

Post by *JnLLnd »

Hi,

I can open a special folder in the existing file list using commands (in AHK v1.1):

Code: Select all

intTCCommand := 2127 ; cm_OpenRecycled
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD

Code: Select all

intTCCommand := 2122 ; cm_OpenDrives
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD
But I can't find how to open the target special folder in a new tab of the existing window or in a second (or third) TC window. I tried to open a new window or a new tab before the SendMessage but it does not work if there is an existing TC window.

Code: Select all

intTCCommand := 2122 ; cm_OpenDrives
run, C:\totalcmd\TOTALCMD64.EXE /N ; new window
Sleep, 500
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD

Code: Select all

intTCCommand := 2122 ; cm_OpenDrives
run, C:\totalcmd\TOTALCMD64.EXE /O /T ; new tab in the existing window
Sleep, 500
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD
Any idea?
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
User avatar
JnLLnd
Junior Member
Junior Member
Posts: 53
Joined: 2014-10-01, 12:14 UTC
Location: Montreal, Canada
Contact:

Post by *JnLLnd »

On another note, I can't make work the cm_OpenControls command to open the Control panel in TC:

Code: Select all

run, C:\totalcmd\TOTALCMD64.EXE
Sleep, 1000
intTCCommand := 2122 ; cm_OpenDrives
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD ; works
MsgBox, cm_OpenDrives worked
intTCCommand := 2123 ; cm_OpenControls
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD ; does not work
MsgBox, cm_OpenControls did NOT work
intTCCommand := 2127 ; cm_OpenRecycled
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD ; works
MsgBox, cm_OpenRecycled worked
This is the only special folders cm_ command not working.
Author of the TC compatible freeware Quick Access Popup
QAP: http://www.quickaccesspopup.com
Other apps: http://code.jeanlalonde.ca
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Post by *hi5 »

To open a new tab you need to use another SendMessage first

Code: Select all

cm_OpenNewTab=3001 ;Open new tab
SendMessage, 0x433, %cm_OpenNewTab%, , , ahk_class TTOTAL_CMD
look in TOTALCMD.INC for all codes (if you haven't already) - there is also a section on Tabs.

The cm_OpenControls works fine here, both 32 and 64 bit. What does the error level say:

Code: Select all

intTCCommand := 2123 ; cm_OpenControls
SendMessage, 0x433, %intTCCommand%, , , ahk_class TTOTAL_CMD ; does not work
MsgBox, cm_OpenControls did NOT work Errorlevel: %Errorlevel%
- note it can be a bit slow...
Post Reply