ListLoadNext
 
New in Total Commander 7: ListLoadNext is called when a user switches to the next or previous file in lister with 'n' or 'p' keys, or goes to the next/previous file in the Quick View Panel, and when the definition string either doesn't exist, or its evaluation returns true.
 
Declaration:
 
int __stdcall ListLoadNext(HWND ParentWin,HWND ListWin,char* FileToLoad,int ShowFlags);
 
Description of parameters:
 
ParentWin This is lister's window. Your plugin window needs to be a child of this window
 
ListWin The plugin window returned by ListLoad
 
FileToLoad The name of the file which has to be loaded.
 
ShowFlags A combination of the following flags:
lcp_wraptext Text: Word wrap mode is checked
lcp_fittowindow Images: Fit image to window is checked
lcp_fitlargeronly Fit image to window only if larger than the window.
Always set together with lcp_fittowindow.
lcp_center Center image in viewer window
lcp_ansi Ansi charset is checked
lcp_ascii Ascii(DOS) charset is checked
lcp_variable Variable width charset is checked
lcp_forceshow User chose 'Image/Multimedia' from the menu. See remarks.
lcp_darkmode Total Commander is in dark mode
lcp_darkmodenative Windows 10/11 supports dark mode natively, e.g. for scroll bars
You may ignore these parameters if they don't apply to your document type.
 
Return value:
 
Return LISTPLUGIN_OK if load succeeds, LISTPLUGIN_ERROR otherwise. If LISTPLUGIN_ERROR is returned, Lister will try to load the file with the normal ListLoad function (also with other plugins).
 
Remarks:
 
Please note that multiple Lister windows can be open at the same time! Therefore you cannot save settings in global variables. You can call RegisterClass with the parameter cbWndExtra to reserve extra space for your data, which you can then access via GetWindowLong(). Or use an internal list, and store the list parameter via SetWindowLong(hwnd,GWL_ID,...).
Lister will subclass your window to catch some hotkeys like 'n' or 'p'.
When lister is activated, it will set the focus to your window. If your window contains child windows, then make sure that you set the focus to the correct child when your main window receives the focus!
If lcp_forceshow is defined, you may try to load the file even if the plugin wasn't made for it. Example: A plugin with line numbers may only show the file as such when the user explicitly chooses 'Image/Multimedia' from the menu.
 
Lister plugins which only create thumbnail images do not need to implement this function. If you do not implement LIstLoadNext but only ListLoad, then the plugin will be unloaded and loaded again when switching through files, which results in flickering.