ListLoad
 
ListLoad is called when a user opens lister with F3 or the Quick View Panel with Ctrl+Q, and when the definition string either doesn't exist, or its evaluation returns true.
 
Declaration:
 
HWND __stdcall ListLoad(HWND ParentWin,char* FileToLoad,int ShowFlags);
 
Description of parameters:
 
ParentWin This is lister's window. Create your plugin window as a child of this window.
 
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 a handle to your window if load succeeds, NULL otherwise. If NULL is returned, Lister will try the next plugin.
 
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.