Folder tabs - get them into my delphi program ?
Moderators: Hacker, petermad, Stefan2, white
Folder tabs - get them into my delphi program ?
Hi all,
I have written a Delphi program - A TC AddOn - that does complex work (see below).
It already works fine, but I would like to be able to let it grab automatically the list of the currently displayed tabs in the "source" pane, when my program is installed in TC's button-bar.
I know, (and used in my CopyToTabs) about the %P%S %T%M parameters, but found nothing about recuperating TAB folders list.
Of course it would be possible to write a temporary *.TAB file, read it into my program and work out my folders list but this too cannot (as far as I know) be done from a Delphi program, or can it? (would solve my problem).
//************************************************
My program does the following:
I always back up files (my stuff, software, important docs etc.) to 4 external disks.
This involves modifying one of them (delete, folder-rename/redate, copy etc.) until it suits my needs. Let's call this HD HDA. Then I need to:
1 Delete all folders on the three other disks (=tabs) that have been modified on HDA
2 Copy all modified folders on HDA onto the other 3 disks.
Manually it is very time consuming, with my program I am immediately free to do something else.
The 3 destinations (or, of course, any number) are in three TABS because I open all four of them using a .TAB file. My manually modified one is the leftmost tab. Hence my need to read them into my program.
[ Currently I compute the destinations based on the source as the folders structures are identical, but this is not "elegant". ]
Thanks in advance,
I have written a Delphi program - A TC AddOn - that does complex work (see below).
It already works fine, but I would like to be able to let it grab automatically the list of the currently displayed tabs in the "source" pane, when my program is installed in TC's button-bar.
I know, (and used in my CopyToTabs) about the %P%S %T%M parameters, but found nothing about recuperating TAB folders list.
Of course it would be possible to write a temporary *.TAB file, read it into my program and work out my folders list but this too cannot (as far as I know) be done from a Delphi program, or can it? (would solve my problem).
//************************************************
My program does the following:
I always back up files (my stuff, software, important docs etc.) to 4 external disks.
This involves modifying one of them (delete, folder-rename/redate, copy etc.) until it suits my needs. Let's call this HD HDA. Then I need to:
1 Delete all folders on the three other disks (=tabs) that have been modified on HDA
2 Copy all modified folders on HDA onto the other 3 disks.
Manually it is very time consuming, with my program I am immediately free to do something else.
The 3 destinations (or, of course, any number) are in three TABS because I open all four of them using a .TAB file. My manually modified one is the leftmost tab. Hence my need to read them into my program.
[ Currently I compute the destinations based on the source as the folders structures are identical, but this is not "elegant". ]
Thanks in advance,
- ghisler(Author)
- Site Admin
- Posts: 50923
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
There is no direct way to get the tabs. But the following would work:
1. Send cm_ConfigSaveSettings command
2. Read the inactive tabs from [lefttabs] and [righttabs] from wincmd.ini, the active tabs from [left] and [right]
1. Send cm_ConfigSaveSettings command
2. Read the inactive tabs from [lefttabs] and [righttabs] from wincmd.ini, the active tabs from [left] and [right]
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
You have to send a WM_USER+51 window message with the cm code (580 in this case).
No idea how it works in Delphi but search the forum for "WM_USER" and you'll find this for example: Using SendMessage with AutoIt.
The codes are listed in TOTALCMD.INC:
cm_ConfigSaveSettings=580;Save current paths etc.
No idea how it works in Delphi but search the forum for "WM_USER" and you'll find this for example: Using SendMessage with AutoIt.
The codes are listed in TOTALCMD.INC:
cm_ConfigSaveSettings=580;Save current paths etc.
Hi all,
I promised to report back ... Failure.
Here are the relevant lines in my program:
*********************************************
interface
uses ...
// I added:
const
TC_Save_Config = WM_USER + 51;
// in Private:
private
{ Private declarations }
procedure OnMyMessage(var Msg: TMessage); message TC_Save_Config;
// in FormActivate:
procedure TForm1.FormActivate(Sender: TObject);
VAR
...
h: HWND;
begin
h := FindWindow(nil, 'Total Commander'); // OK, TC IS FOUND (I checked)
if IsWindow(h) then SendMessage(h, TC_Save_Config, 580, 580); // I don't know how to send the 580.
// **************************************
and nothing happens in WinCmd.ini.
What am I doing wrong ??
I promised to report back ... Failure.
Here are the relevant lines in my program:
*********************************************
interface
uses ...
// I added:
const
TC_Save_Config = WM_USER + 51;
// in Private:
private
{ Private declarations }
procedure OnMyMessage(var Msg: TMessage); message TC_Save_Config;
// in FormActivate:
procedure TForm1.FormActivate(Sender: TObject);
VAR
...
h: HWND;
begin
h := FindWindow(nil, 'Total Commander'); // OK, TC IS FOUND (I checked)
if IsWindow(h) then SendMessage(h, TC_Save_Config, 580, 580); // I don't know how to send the 580.
// **************************************
and nothing happens in WinCmd.ini.
What am I doing wrong ??
Try getting the handle by the class name: TTOTAL_CMD
I guess that would be:
h := FindWindow('TTOTAL_CMD', nil);
if IsWindow(h) then SendMessage(h, TC_Save_Config, 580, 0);
You can use WinSpector to see the incoming messages and correct handles.
I guess that would be:
h := FindWindow('TTOTAL_CMD', nil);
if IsWindow(h) then SendMessage(h, TC_Save_Config, 580, 0);
You can use WinSpector to see the incoming messages and correct handles.
Last edited by ZoSTeR on 2014-03-22, 11:26 UTC, edited 1 time in total.