FsPlugin: reloading current directory

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

Moderators: Stefan2, white, sheep, Hacker

Post Reply
Loc2262
Member
Member
Posts: 124
Joined: 2005-01-26, 01:59 UTC

FsPlugin: reloading current directory

Post by *Loc2262 » 2005-01-26, 02:04 UTC

Hello all!

I have a little question:

I'm writing a filesystem plugin, and want to have it execute some internal action when the user "runs" a certain pseudo-file. No problem here with the FsExecuteFile function. But the action will change the directory that is currently being displayed.

Is there a way to have TC automatically reload the current directory to display the changes made during the FsExecuteFile call?

Thanks in advance for help!
Gruß,
Frank

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2005-01-27, 19:25 UTC

Is there a way to have TC automatically reload the current directory to display the changes made during the FsExecuteFile call?
The only way to do this is use PostMessage to send a message WM_USER+51 to TC with the cm_xxx command in WPARAM and LPARAM set to 0. The command to send is cm_RereadSource (see wincmd.inc for numeric value).
Author of Total Commander
http://www.ghisler.com

Loc2262
Member
Member
Posts: 124
Joined: 2005-01-26, 01:59 UTC

Post by *Loc2262 » 2005-01-27, 20:09 UTC

ghisler(Author) wrote:The only way to do this is use PostMessage to send a message WM_USER+51 to TC
Okay great, thanks!

Is there also any way to retrieve TC's window handle (besides some FindWindow API calls)? :)
Gruß,
Frank

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2005-01-27, 21:11 UTC

When your item is activated, you can assume that the user is using TC, so just use GetActiveWindow().
Author of Total Commander
http://www.ghisler.com

VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP » 2005-01-28, 07:52 UTC

When your item is activated, you can assume that the user is using TC, so just use GetActiveWindow().
In most cases it works but there still several pitfalls.
1. If FS-plugin activated as result of command sent from script or another application (like TCMenu) TC may be in background.
2. There can be also unexpected popup window (ZoneAlarm, antivirus etc).

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2005-01-28, 11:04 UTC

The only problem in this case would be that there is no refresh...
Author of Total Commander
http://www.ghisler.com

VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP » 2005-01-28, 15:51 UTC

The only problem in this case would be that there is no refresh...
...and message WM_USER+51 will be delivered to unpredicted window... ;)

User avatar
ctiberg
Member
Member
Posts: 194
Joined: 2003-10-24, 14:10 UTC
Location: Kristianstad, Sweden

Post by *ctiberg » 2005-01-28, 16:09 UTC

Hello!

Excuse me for butting in, but what about FS_EXEC_SYMLINK? We're using that to do the reload, passing the current directory...
Best regards,
Christian Tiberg

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2005-01-31, 19:24 UTC

2ctiberg
Yes, that's what I suggested too to a plugin writer, but he told me that it didn't work for him. Does it work for you?
Author of Total Commander
http://www.ghisler.com

Loc2262
Member
Member
Posts: 124
Joined: 2005-01-26, 01:59 UTC

Post by *Loc2262 » 2005-02-01, 18:29 UTC

ghisler(Author) wrote:[FS_EXEC_SYMLINK]
Yes, that's what I suggested too to a plugin writer, but he told me that it didn't work for him. Does it work for you?
Yes I indeed tried that as a first idea, but for me that did not work as well.

For my purpose, it's not that much a problem if the reload fails (it's just for an "empty project" command for a burning plugin I'm writing), but maybe it would be a good idea to implement a "controlled" means to do that for a future version of the plugin interface. :)
Gruß,
Frank

User avatar
ctiberg
Member
Member
Posts: 194
Joined: 2003-10-24, 14:10 UTC
Location: Kristianstad, Sweden

Post by *ctiberg » 2005-02-02, 08:25 UTC

ghisler(Author) wrote:2ctiberg
Yes, that's what I suggested too to a plugin writer, but he told me that it didn't work for him. Does it work for you?
Yes, without any problems at all...
Best regards,
Christian Tiberg

User avatar
Lefteous
Power Member
Power Member
Posts: 9457
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous » 2005-02-02, 09:39 UTC

2Loc2262
(it's just for an "empty project" command for a burning plugin I'm writing
What kind of burning plugin is that?

Loc2262
Member
Member
Posts: 124
Joined: 2005-01-26, 01:59 UTC

Post by *Loc2262 » 2005-02-03, 21:57 UTC

Lefteous wrote:2Loc2262
(it's just for an "empty project" command for a burning plugin I'm writing
What kind of burning plugin is that?
It's gonna be a CD/DVD burning plugin that can write Data CD/DVDs, Video DVDs and Audio CDs (for now, VCD and SVCD will follow :) ), on the usual kinds of media (CD-R/RW, DVD+-R/RW).

It'll be ready in some days, am working on the documentation ATM. :)
Gruß,
Frank

User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk » 2005-02-04, 08:22 UTC

2Loc2262
Sounds nice ;-)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl

djorge
Senior Member
Senior Member
Posts: 421
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge » 2006-07-15, 16:25 UTC

Is there a way of refreshing the inactive pannel?
______________________
David Jorge
Personal License #117854

Post Reply