Question: Reread FS file panel

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Question: Reread FS file panel

Post by *Alextp »

Hello,

I want to implement is my FS plugin command "Reread" called by file item on panel (called in FsExecuteFile).
Because I don't need to reread sctuctures on every Ctrl+R press.

1. How can I run Reread on plugin opening? In what function may I run it (in FsFindFirst?)?
2. How can I set that after this Reread - TC rereads file panel?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, you can't - it's up to the user to press Ctrl+R or F2. What you can do is add a pseudo file called <reread> or so, which will return a redirect to the same directory.
Author of Total Commander
https://www.ghisler.com
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2ghisler(Author)
How can I set that file "reread" will return redirect to the same directory?
Tell more pls or give me a sample source...
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

Ok, I found out how to do it: just to call RereadPanel(MainWin) from FsExecuteFile
(MainWin is parameter of FsExecuteFile):

Code: Select all

procedure RereadPanel(hWnd: THandle);
const
  EM_DISPLAYBAND = WM_USER+51;
  cm_RereadSource = 540;
begin
  Sleep(200);
  SendMessage(hWnd, EM_DISPLAYBAND, cm_RereadSource, 0);
  Sleep(200);
end;
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, I meant the following:
c) If the file is a (symbolic) link, set RemoteName to the location to which the link points (including the full plugin path), and return FS_EXEC_SYMLINK. Total Commander will then switch to that directory. You can also switch to a directory on the local harddisk! To do this, return a path starting either with a drive letter, or an UNC location (\\server\share). The maximum allowed length of such a path is MAX_PATH-1 = 259 characters!
The returned path must be the current path (without the name of the file called <reread>).
Author of Total Commander
https://www.ghisler.com
Post Reply