VitrualPanel, TC Hotlist and Quick Access Popup
Moderators: Hacker, petermad, Stefan2, white
VitrualPanel, TC Hotlist and Quick Access Popup
@MVV (author of VirtualPanel)
I'm the author of Quick Access Popup. As part of its integration with TC, QAP reads the TC Hotlist ([DirMenu] section in ini file) to build a popup menu with it. A QAP and TC user took to my attention that Hotlist entries using VP could not be launched from QAP menu as could be regular directories in the Hotlist.
See this thread:
http://www.quickaccesspopup.com/how-do-i-enable-total-commander-support-in-quick-access-popup/#comment-11791
I lack time actually for installing and learning VP. Your help would be appreciated. Two questions:
1) Is there a safe way to recognize VP entries in TC Hotlist so than I can exclude them until I can build support for this in QAP?
2) For longer term, is there a way to call an entry like cmd39=cd \\\VP\project1 from an external program and get the actual path/command to show its content in TC?
FYI, QAP is sending commands to TC using AutoHotkey "SendMessage" commands (for example: SendMessage, 0x433, %g_strFullLocation%, , , ahk_class TTOTAL_CMD.
Thanks for your help,
Jean
I'm the author of Quick Access Popup. As part of its integration with TC, QAP reads the TC Hotlist ([DirMenu] section in ini file) to build a popup menu with it. A QAP and TC user took to my attention that Hotlist entries using VP could not be launched from QAP menu as could be regular directories in the Hotlist.
See this thread:
http://www.quickaccesspopup.com/how-do-i-enable-total-commander-support-in-quick-access-popup/#comment-11791
I lack time actually for installing and learning VP. Your help would be appreciated. Two questions:
1) Is there a safe way to recognize VP entries in TC Hotlist so than I can exclude them until I can build support for this in QAP?
2) For longer term, is there a way to call an entry like cmd39=cd \\\VP\project1 from an external program and get the actual path/command to show its content in TC?
FYI, QAP is sending commands to TC using AutoHotkey "SendMessage" commands (for example: SendMessage, 0x433, %g_strFullLocation%, , , ahk_class TTOTAL_CMD.
Thanks for your help,
Jean
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
Sorry, I am not MVV (my hero!), but fifty cents burn pocket 
1) "\VirtualPanel" is default name, but this name is optional (as for other wfx-plugins): you must find him for current TC copy and find "\\\Name\" in your string. For example on AutoIt (pieces of my script):
_TCPlugSearch() is my universal function for all plugins +support RedirectSection & AlternateUserIni, but you can make it shorter because QAP uses DirMenu and already "knows" current TC configuration file.
2) If you want to open this path then you can use WM_COPYDATA:
Or you can try
without "cd " and WM_COPYDATA (I have not tried).

1) "\VirtualPanel" is default name, but this name is optional (as for other wfx-plugins): you must find him for current TC copy and find "\\\Name\" in your string. For example on AutoIt (pieces of my script):
Code: Select all
#NoTrayIcon
Opt('WinWaitDelay', 100)
Local $your_path = '\\\VP\project1'
Local $aTCPlugName = _TCPlugSearch('VirtualPanel.wfx', 'FileSystemPlugins') ;First plugin copy
If IsArray($aTCPlugName) Then
If StringInStr($your_path, '\\\' & $aTCPlugName[0]) & '\') Then
MsgBox(64 + 4096, 'AddProfileToVirtualPanel.au3', '"' & $your_path & '" is VirtualPanel path!')
Else
MsgBox(16 + 4096, 'AddProfileToVirtualPanel.au3', '"' & $your_path & '" is not VirtualPanel path!')
EndIf
Else
MsgBox(48 + 4096, 'AddProfileToVirtualPanel.au3', 'Plugin VirtualPanel not found!')
EndIf
Func _TCPlugSearch($name, $type)
;$name = w?x-name
;$type = 'PackerPlugins' or 'FileSystemPlugins' or 'ListerPlugins' or 'ContentPlugins'
;Return array: [name/ext/index, w?x path]
Local $T, $sConfig, $aTCPs, $i, $aRet[2], $COMMANDER_INI = EnvGet('COMMANDER_INI')
$T = IniRead($COMMANDER_INI, $type, 'RedirectSection', 'def')
Switch $T
Case 0, 'def'
$sConfig = $COMMANDER_INI
Case 1
$sConfig = IniRead($COMMANDER_INI, 'Configuration', 'AlternateUserIni', 'def')
If $sConfig = 'def' Then Return 0
$sConfig = _WinAPI_ExpandEnvironmentStrings($sConfig)
If Not FileExists($sConfig) Then
$sConfig = StringRegExpReplace($COMMANDER_INI, '\\[^\\]+$', '\\' & $T)
If Not FileExists($sConfig) Then
Return 0
EndIf
EndIf
Case Else
$sConfig = _WinAPI_ExpandEnvironmentStrings($T)
If Not FileExists($sConfig) Then
$sConfig = StringRegExpReplace($COMMANDER_INI, '\\[^\\]+$', '\\' & $T)
If Not FileExists($sConfig) Then
Return 0
EndIf
EndIf
EndSwitch
$aTCPs = IniReadSection($sConfig, $type)
For $i = 1 To $aTCPs[0][0]
If StringInStr($aTCPs[$i][1], $name) Then
$aRet[0] = $aTCPs[$i][0]
If $type = 'PackerPlugins' Then
$aRet[1] = StringRegExpReplace($aTCPs[$i][1], '^\d+,', '', 1)
Else
$aRet[1] = $aTCPs[$i][1]
EndIf
Return $aRet
Else
ContinueLoop
EndIf
Next
Return 0
EndFunc ;==>_TCPlugSearch
Func _WinAPI_ExpandEnvironmentStrings($sString)
Local $aResult = DllCall("kernel32.dll", "dword", "ExpandEnvironmentStringsW", "wstr", $sString, "wstr", "", "dword", 4096)
If @error Then Return SetError(@error, @extended, "")
Return $aResult[2]
EndFunc ;==>_WinAPI_ExpandEnvironmentStrings
2) If you want to open this path then you can use WM_COPYDATA:
Code: Select all
Global Const $WM_COPYDATA = 0x004A
;ТС window handle (for WM_COPYDATA)
Local $hTC = WinGetHandle('[CLASS:TTOTAL_CMD]')
If @error Then
MsgBox(48 + 4096, 'AddProfileToVirtualPanel.au3', 'TC not found!')
Exit
EndIf
;Script window handle (for WM_COPYDATA too)
AutoItWinSetTitle(@ScriptName)
$hWndPar = WinGetHandle(@ScriptName)
;cd \\\VP\project1, current tab
_TC_cd_command(__CheckANSItoUTF8($your_path), '', 'S')
; ANSI >> UTF-8 (if need)
Func __CheckANSItoUTF8($sStr)
Local $sStrTemp, $BOM = Chr(239) & Chr(187) & Chr(191) ; \xEF \xBB \xBF
$sStrTemp = BinaryToString(StringToBinary($sStr, 1), 1)
If Not ($sStr == $sStrTemp) Then
$sStr = BinaryToString(StringToBinary($sStr, 4))
Return $BOM & $sStr
Else
Return $sStr
EndIf
EndFunc ;==>__CheckANSItoUTF8
Func _TC_cd_command($l, $r, $sFlag = "")
Local $sCommand = $l & @CR & $r & ChrW(0) & $sFlag
Local $pCDcom = DllStructCreate("char[" & StringLen($sCommand)+ 1 & "]")
Local $pCopyData = DllStructCreate("ulong_ptr;dword;ptr")
DllStructSetData($pCDcom, 1, $sCommand)
DllStructSetData($pCopyData, 1, Asc("C") + 256 * Asc("D"))
DllStructSetData($pCopyData, 2, DllStructGetSize($pCDcom))
DllStructSetData($pCopyData, 3, DllStructGetPtr($pCDcom))
DllCall("user32.dll", "int", "SendMessageW", "hwnd", $hTC, "int", $WM_COPYDATA, "wparam", $hWndPar, "lparam", DllStructGetPtr($pCopyData))
EndFunc ;==>_TC_cd_command
Code: Select all
"%COMMANDER_PATH% /O /S /L="\\\VP\project1"
Last edited by Skif_off on 2016-09-18, 14:46 UTC, edited 1 time in total.
Thank you Skif_off for all this info.
Could you send me a sample of the section [FileSystemPlugins] of the ini file when VP is installed? It will help.
Could you send me a sample of the section [FileSystemPlugins] of the ini file when VP is installed? It will help.
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
The FileSystemPlugin section can be found in the wincmd.ini but it can also be "redirected" to other file. (You can read the redirections from wincmd.ini).JnLLnd wrote:Thank you Skif_off for all this info.
Could you send me a sample of the section [FileSystemPlugins] of the ini file when VP is installed? It will help.
the safiest way to get wich wincmd ini file is used, is to query TC using CopyDATA messaging.
But the easiest way would be to just add a parameter in your application to "detect VirtualPanel prefixe/s".
normal mesages to change folder should work (adding "") at the end to go "inside" the folder
2JnLLnd
I use default name without redirections:
2nsp
I use default name without redirections:
Code: Select all
[FileSystemPlugins]
VirtualPanel=%COMMANDER_PATH%\Plugins\wfx\VirtualPanel\VirtualPanel.wfx
How? I did not find: history852.txt, history900.txt.nsp wrote:the safiest way to get wich wincmd ini file is used, is to query TC using CopyDATA messaging.
I guessed that all the requests about TC context was covered by the messaging system. I was wrong about %COMMANDER_INI%2nspHow? I did not find: history852.txt, history900.txt.nsp wrote:the safiest way to get wich wincmd ini file is used, is to query TC using CopyDATA messaging.

If you can be called by TC the %COMMANDER_INI% var contain the current ini file path. Reading registry can help but does not cover all the situations.
With FileSystem plugins, you need to add a final "" if you want the path to be considered as a folder destination.
And could you show me what are the entries for VirtualPanel destinations in [DirMenu] (Hotlist) section of WinCdd.ini?Skif_off wrote:2JnLLnd
I use default name without redirections:Code: Select all
[FileSystemPlugins] VirtualPanel=%COMMANDER_PATH%\Plugins\wfx\VirtualPanel\VirtualPanel.wfx
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
2JnLLnd
Click "*" >> "Add current dir":
I am sorry, I made a mistake:
I corrected my post ($hWndPar too).
And about "", what nsp wrote:
Click "*" >> "Add current dir":
Code: Select all
menu72=Test
cmd72=cd \\\VirtualPanel\Test
This is wrong and unnecessary for you: I use calls VPBatch.exe to add new folders, but VPBatch.exe not works if plugin VirtualPanel not loaded. I am sorrySkif_off wrote:2) If you want to open this path then you can use WM_COPYDATA, but you must load plugin first (open "\\\VP"):

And about "", what nsp wrote:
06.07.16 Release Total Commander 9.0 beta 4 (32/64)
03.07.16 Fixed: Search in separate process, go to file: not working with FS plugins, tried to open file as directory. Change: Plugin path received via WM_COPYDATA must end with \ if it's not a file (32/64)
Thanks Skif_off. This helps. I got the whole picture with it.Skif_off wrote:2JnLLnd
Click "*" >> "Add current dir":Code: Select all
menu72=Test cmd72=cd \\\VirtualPanel\Test
If I summarize, I have to check the[FileSystemPlugins] section of WinCdm.ini for a variable name (var_name) that would be used in the [DirMenu] section in the following format:
Code: Select all
cmd#=cd \\\var_name\etc.
Thanks 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
I don't understand why do you search for Virtual Panel only entries because all FS plugins work in a similar way, and paths for all of them start with \\\, so this prefix is a very good signature of FS plugin path.
And, as it was mentioned, you should use WM_COPYDATA message to tell TC to change current directory. Or you can use this slow but simple way: TOTALCMD.exe /S /O /L="path". Both ways allow opening new folder in new tab.
And, as it was mentioned, you should use WM_COPYDATA message to tell TC to change current directory. Or you can use this slow but simple way: TOTALCMD.exe /S /O /L="path". Both ways allow opening new folder in new tab.
Hi MVV,
Thinking about this on my bike this morning, it was exactly my next question: is the triple-backslash a convention for all file system plugins. Got it. Thanks.
I'm using TOTALCMD.EXE with a combination of switches to open in the current tab, or in a new tab (and on which side), or in a complete new instance of TC. I could switch to WM_COPYDATA but if this is only for speed improvement, this is not a big gain in this situation.
However, if using WM_COPYDATA would allow to change to a VP folder this would be an interesting benefit. Would it?
Thinking about this on my bike this morning, it was exactly my next question: is the triple-backslash a convention for all file system plugins. Got it. Thanks.
I'm using TOTALCMD.EXE with a combination of switches to open in the current tab, or in a new tab (and on which side), or in a complete new instance of TC. I could switch to WM_COPYDATA but if this is only for speed improvement, this is not a big gain in this situation.
However, if using WM_COPYDATA would allow to change to a VP folder this would be an interesting benefit. Would it?
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
Both TOTALCMD.EXE with /O argument and WM_COPYDATA allow switching to any FS plugin folder w/o problems, just tried that and it works:
In fact, you don't need to bother what kind of path you have, TC should do all job for you.
Code: Select all
TOTALCMD.EXE /S /O /L="\\\Virtual Panel\Pictures\"
OK. I'll return to my user who reported an issue with this. The issue may not be related to plugins. Thanks for checking.MVV wrote:Both TOTALCMD.EXE with /O argument and WM_COPYDATA allow switching to any FS plugin folder w/o problems
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
OK. Thanks.MVV wrote:You should keep in mind that some plugins don't support switching to inner directory, but in such case hotlist should work in the same way as remote directory switch command.
After more input from QAP+TC user, I found that the cause of this issue was not what I was thinking. This is because QAP checks if a favorite folder exists before opening it. Because it checks this outside TC, it cannot find the virtual folder and it does not even try to open it (if it was trying, it could open it with TC).
In the next release, QAP will stop checking if folder exists if:
1) it is launched from TC Directory Hotlist and
2) the location starts with “\\\”.
No need for additional coding to support TC file system plugins like VirtualPanel.
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