load file partially in Lister plugin

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
nhmarkco
Junior Member
Junior Member
Posts: 8
Joined: 2005-01-21, 21:52 UTC

load file partially in Lister plugin

Post by *nhmarkco »

Hi,

How does the lc_setpercent Command in ListSendCommand work? In the sample plugin this command is never sent. I need to view huge files that have a custom format.

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

Post by *ghisler(Author) »

TC calls ListSendCommand with this parameter when the user clicks the % item in the main menu and enters a percentage value. Your plugin can react to this by scrolling to the approppriate position in the document (if applicable).
Author of Total Commander
https://www.ghisler.com
nhmarkco
Junior Member
Junior Member
Posts: 8
Joined: 2005-01-21, 21:52 UTC

Post by *nhmarkco »

Hi,

In your internal and external Lister when scrolling a variable percentage is displayed above the scroll bar. In the sample lister the percentage is fixed at "0%".

How do I hook scrolling in my custom lister?

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

Post by *ghisler(Author) »

See the documentation of WM_COMMAND in the lister plugin interface help. The plugin has to send itm_percent messages to the calling program to update the % display.
Author of Total Commander
https://www.ghisler.com
nhmarkco
Junior Member
Junior Member
Posts: 8
Joined: 2005-01-21, 21:52 UTC

how to react to operator scrolling?

Post by *nhmarkco »

Hi,

From the The internal file lister (F3) Help:
"The integrated file lister allows to view files of almost any size (now up to 2^63 bytes) in text, unicode, html, binary or hex format, bitmap graphics, multimedia files, and now also RTF files. It keeps only a small part of the file in memory (except for bitmaps), the rest is automatically loaded when scrolling through the text."

Huge files, I need to do the "It keeps only a small part of the file in memory (except for bitmaps), the rest is automatically loaded when scrolling through the text." part in my custom lister.
WM_COMMAND shows how to post the percentage, but not how to hook the "when scrolling" to know what section to display and what percentage to post.

I tried this:
SendMessage(hwnd, EM_SETEVENTMASK, 0, ENM_UPDATE|ENM_SCROLL);
, it didn't work. How do I get scroll notifications in a custom lister?


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

Post by *ghisler(Author) »

Try this:

SendMessage(hlisterwnd, WM_COMMAND, itm_percent, percentvalue);
Author of Total Commander
https://www.ghisler.com
Post Reply