Preview .TXT files not working

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
CB-Crew
Posts: 5
Joined: Tue Mar 07, 2023 4:53 pm

Preview .TXT files not working

Post by CB-Crew »

Hello,

I have the impression that the preview of .TXT files in Void has recently stopped working. The preview in Microsoft File Explorer and also in XyPlorer, which I use, works quickly and without any problems.

What could I do? The preview of many file types works without any problems, only something that you would think would be quite simple does not... :?

Thank you
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Preview .TXT files not working

Post by therube »

OS?
Version of Everything?

Does anything display in the Preview window?
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Preview .TXT files not working

Post by horst.epp »

For me, the actual Everything version 1.5.0.1361a has no problems to preview *.txt files.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

Everything uses the system to render previews.

Please make sure you are using the x64 version of Everything. (Help -> About)

Please make sure Everything is installed correctly and running as a standard user:
  • In Everything, from the Tools menu, click Options.
  • Click the General tab on the left.
  • Check Store settings and data in %APPDATA%\Everything.
  • Uncheck Run as administrator.
  • Check Everything Service. (Please make sure this is tick-checked and not square-checked)
  • Click OK.
  • Exit Everything (right click the Everything tray icon and click Exit).
  • Restart Everything.


Does the issue persist?
CB-Crew
Posts: 5
Joined: Tue Mar 07, 2023 4:53 pm

Re: Preview .TXT files not working

Post by CB-Crew »

horst.epp wrote: Mon Dec 11, 2023 9:05 pm For me, the actual Everything version 1.5.0.1361a has no problems to preview *.txt files.
Hello Horst,
I use Version 1.4.1.1024 (x64). I can only see that Version 1.5 is still in Alpha?
Last edited by CB-Crew on Tue Dec 12, 2023 12:21 pm, edited 1 time in total.
CB-Crew
Posts: 5
Joined: Tue Mar 07, 2023 4:53 pm

Re: Preview .TXT files not working

Post by CB-Crew »

therube wrote: Mon Dec 11, 2023 7:10 pm OS?
Version of Everything?
Does anything display in the Preview window?
Hello

I run:
- Windows 11 Pro
- Version 22H2

- Everthing Version 1.4.1.1024 (x64)

'Everthing' runs like a charm and is a big help for me.

Preview of .PDF files is fast.
.TXT files: no preview
.DOC files: preview works
.xls files: no preview

looks a little bit funny...
void wrote: Mon Dec 11, 2023 10:13 pm Does the issue persist?
Options are set as recommendet in your post.

I think best will be to do a level one repair and reboot my maschine...
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

Please try setting the PerceivedType for .txt files to text:
  • From the Start menu, search for:
    regedit
  • Right click Registry Editor and click Run as administrator.
  • In the registry editor, navigate to:
    HKEY_CLASSES_ROOT\.txt
  • On the right side, please make sure PerceivedType is set to: text
Coasting3122
Posts: 2
Joined: Fri Jan 12, 2024 5:26 pm

Re: Preview .TXT files not working

Post by Coasting3122 »

void wrote: Mon Dec 11, 2023 10:13 pm Everything uses the system to render previews.

Please make sure you are using the x64 version of Everything. (Help -> About)

Please make sure Everything is installed correctly and running as a standard user:
  • In Everything, from the Tools menu, click Options.
  • Click the General tab on the left.
  • Check Store settings and data in %APPDATA%\Everything.
  • Uncheck Run as administrator.
  • Check Everything Service. (Please make sure this is tick-checked and not square-checked)
  • Click OK.
  • Exit Everything (right click the Everything tray icon and click Exit).
  • Restart Everything.
Does the issue persist?
Howdy! I just verified all these steps and am still not getting preview on anything. Not sure when / why this started. It was working fine a few days ago with text based files (.txt, .md, .json, etc.) I am on Win 10 22H2 with all current updates. Everything Version 1.5.0.1363a (x64)

Any ideas, or info I can gather?
Coasting3122
Posts: 2
Joined: Fri Jan 12, 2024 5:26 pm

Re: Preview .TXT files not working

Post by Coasting3122 »

Answering my own question:

I just remembered that Windows Explorer has a built-in preview pane and that was not working either. It looks like the option must have gotten disabled somehow (maybe a recent patch?).

Open File Explorer
On the View Ribbon, click Options
On the resulting dialog, choose the View Tab
Scroll down to find ‘Show preview handlers in preview pane’ and make sure the option is checked (enabled)

That fixed the problem for me.
previewPane.JPG
previewPane.JPG (45.42 KiB) Viewed 14217 times
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Preview .TXT files not working

Post by NotNull »

Just for the record:

Everything previews can be configured independently from the Explorer setting.
This is controlled by the show_preview_handlers_in_preview_pane setting.
Setting this to 1, will provide previews in Everything, even when disabled in Explorer.

(requires a restart of Everything)


show_preview_handlers_in_preview_pane
Jolly
Posts: 17
Joined: Fri Oct 25, 2019 10:19 pm

Re: Preview .TXT files not working

Post by Jolly »

Is there a way to force unknown file types to show as text in the preview pane?
For example, .cmd or unknown file types
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Preview .TXT files not working

Post by NotNull »

You can use the same method as described for .txt files above by void:
But instead of .txt, navigate to .cmd

Please try setting the PerceivedType for .txt files to text:
  • From the Start menu, search for:
    regedit
  • Right click Registry Editor and click Run as administrator.
  • In the registry editor, navigate to:
    HKEY_CLASSES_ROOT\.txt
  • On the right side, please make sure PerceivedType is set to: text
Jolly
Posts: 17
Joined: Fri Oct 25, 2019 10:19 pm

Re: Preview .TXT files not working

Post by Jolly »

That worked for cmd, but I really need a way to have everything's preview handle unknown file names as text.
I'm often using backup files that have changing file extensions: Image

Ideally, everything uses a text handler for unknown files, unless it has invalid encoding, and then use a hex viewer.
Attachments
Screenshot 2024-02-23 142832.png
Screenshot 2024-02-23 142832.png (120.71 KiB) Viewed 13452 times
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Preview .TXT files not working

Post by NotNull »

Everything has a feature where it lets you define your own preview handler for some extensions. This will overrule the Windows setting.
So Window (Explorer) uses handler A and Everything then can use handler B.

The Everything preview definitions not only allow extensions, but also (regular expression) patterns.
If you are able to define patterns to match, you can use this mechanism.

Matching will be done in order of defining: the first patter/extension that matches will be used.
So in theory you could use a fetch-all pattern at the end to show all remaining files using the defined preview handler.

This will effectively ignore all Windows settings for previews. Meaning that you will need to define (and maintain) all filetypes in the Everything preview definitions, including PDF, docx, etc.
There might be a maximum length of these definitions involved. (Don't know, but seems likely)



preview_handlers INI setting.


For example -- and as a test -- the following preview_handlers setting seems to cover quite a few cases:

Code: Select all

{"filter":"regex:\.cmd@\\d{4}-\\d{2}-\\d{2}_\\d{6}","handler":"{1531d583-8375-4d3f-b5fb-d23bbd169f22}"}
Jolly
Posts: 17
Joined: Fri Oct 25, 2019 10:19 pm

Re: Preview .TXT files not working

Post by Jolly »

Thanks, that will get me started!

I wonder if there's a way To properly set a catch all handler On windows. I managed to get one sort of working, but it overrides the preview handler for every extension.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

You can set a preview handler for all files with:

HKEY_CLASSES_ROOT\*\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}

Unfortunately, this overrides all other preview handlers.
I don't know of a way to set a fallback.
If you find one, please let us know.



I will consider an option to specify a fallback preview handler for Everything.
You can currently set a * filter in Everything to catch all files, but this too will override all system preview handlers.
Everything will use the first filter match preview handler from your preview_handlers setting.
You would need to add all preview handlers before your * preview handler.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Preview .TXT files not working

Post by NotNull »

void wrote: Fri Mar 01, 2024 6:35 am Unfortunately, this overrides all other preview handlers.
I don't know of a way to set a fallback.
If you find one, please let us know.
There might be a way ..

For experimenting only at this moment as this was only *very* briefly tested
(but seems to work in my simple environment)


Run the following command (as administrator)

Code: Select all

reg.exe add "HKCR\SystemFileAssociations\*\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}" /ve /D "{1531d583-8375-4d3f-b5fb-d23bbd169f22}"
Alternatively: import this regfile ( also as administartor)

fallbackpreview.reg

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SystemFileAssociations\*\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
@="{1531d583-8375-4d3f-b5fb-d23bbd169f22}"


Run the following CMD command (as user) to find which file extensions might give the wrong preview. All other existing previews are untouched.

On my system all these affected extensions are defined on a higher level too, so no issues here (but I don't use a mail client like Outlook on this system)

Code: Select all

for /f "usebackq delims=" %x in (`reg.exe query HKCR\SystemFileAssociations`) do @reg.exe query "%x\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}" 2>nul

Output from my system, slightly compacted (Windows 11):

Code: Select all



HKEY_CLASSES_ROOT\SystemFileAssociations\*\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {1531d583-8375-4d3f-b5fb-d23bbd169f22}
HKEY_CLASSES_ROOT\SystemFileAssociations\.contact\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {13D3C4B8-B179-4ebb-BF62-F704173E7448}
HKEY_CLASSES_ROOT\SystemFileAssociations\.htm\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {f8b8412b-dea3-4130-b36c-5e8be73106ac}
HKEY_CLASSES_ROOT\SystemFileAssociations\.html\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {f8b8412b-dea3-4130-b36c-5e8be73106ac}
HKEY_CLASSES_ROOT\SystemFileAssociations\.mht\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {92dbad9f-5025-49b0-9078-2d78f935e341}
HKEY_CLASSES_ROOT\SystemFileAssociations\.mhtml\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {92dbad9f-5025-49b0-9078-2d78f935e341}
HKEY_CLASSES_ROOT\SystemFileAssociations\.msg\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\.rtf\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {a42c2ccb-67d3-46fa-abe6-7d2f3488c7a3}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/Attachment\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Activity\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Appointment\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Contact\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.DistList\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Message\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Note\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Note.Read\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Post\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Post.Rss\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Schedule.Meeting\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.StickyNote\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\MAPI/IPM.Task\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}
HKEY_CLASSES_ROOT\SystemFileAssociations\text\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
    (Default)    REG_SZ    {1531d583-8375-4d3f-b5fb-d23bbd169f22}

So I needed to test previews of .htm .html .mht .mhtml .msg and .rtf files. All other extensions should be unaffected.
Not all extensions were abvailabel, but what was there previewed just fine.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

The following didn't work for me:

HKEY_CLASSES_ROOT\SystemFileAssociations\*\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}



However, the following did:

HKEY_CLASSES_ROOT\Unknown\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
Set the (default) value to the desired preview handler.
This preview handler will be used as a fallback in Windows Explorer.

"Unknown" is a special "PerceivedType".
There are other PerceivedTypes: audio, image, system, text and video.
The preview handler for these types can be set under:
HKEY_CLASSES_ROOT\SystemFileAssociations\PerceivedType\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}



I'll make some adjustments to Everything so it behaves exactly the same as Windows Explorer.



If you know a good hex viewer preview handler please post it here.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

Everything 1.5.0.1371a will now use:

HKEY_CLASSES_ROOT\unknown\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

Is there an option to do not word wrap TXT preview?
I could not find it.

Thanks.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

Is there an option to do not word wrap TXT preview?
It depends on your TXT preview handler.
It's outside the control of Everything.
Try disabling word wrap in Notepad.



Everything 1.5.0.1372a adds a advanced preview_default_handler setting to set the fallback preview handler for files.
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

void wrote: Thu Apr 18, 2024 11:58 am
Is there an option to do not word wrap TXT preview?
Try disabling word wrap in Notepad.
Unfortunately, it did not work.

void wrote: Thu Apr 18, 2024 11:58 am
Everything 1.5.0.1372a adds a advanced preview_default_handler setting to set the fallback preview handler for files.
Empty is disable.
What else could I add here?
The path for my text editor?
What is the preview handler of the OS?
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

I noted an undesired effect using preview window:
If I press down arrow to preview the next file, the focus goes to the preview window, even if I do not want it.

Expected behavior is to keep the focus on files, to navigate among them with keyboard arrows.
But focus always goes to the window.

[Edited]
It occurs when viewing .docx files.
.txt and image files run fine.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

I am unable to produce the issue on my end.
Tested on Windows 10 with Office 2016.

Everything doesn't set the focus on the preview window.
(unless you enable Tools -> Options -> Advanced -> preview_tab_stop and TAB to the preview pane or press F6)
The focus change is most likely done by the preview handler.

Everything 1.5.0.1374a no longer calls ShowWindow on the preview pane.
This may have inadvertently being activating the preview pane.
Does the issue persist with this version?
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

Thank you for paying attention to that.

Tools -> Options -> Advanced -> preview_tab_stop is false.
I don't press TAB or F6.
I updated from 1.5.0.1372 to 1.5.0.1375a. Same behavior.

I mean, TXT is always wrapping the text.
Focus on DOCX results always goes to the preview pane, when trying to navigate to the next file.

It may be caused by my old system, Windows 7 and Office 2010.
Image 😳

Other issue:
System language is Portuguese. If I press ALT-P to call "Pesquisa" ("Search" on main menu), it turns Preview Pane on, not the underline "P" for "Pesquisa".
w64bit
Posts: 253
Joined: Wed Jan 09, 2013 9:06 am

Re: Preview .TXT files not working

Post by w64bit »

More thing with preview:

1. If I preview a MSG file (outlook message), all it's OK.
If I click on any other file type after that, the preview will not change. I have to close and open again preview pane to make it work.

2. Click on TXT -> preview OK
Click on CHM file after that -> artifacts (lines) appear over preview pane.
Last edited by w64bit on Sat May 11, 2024 9:24 am, edited 2 times in total.
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Preview .TXT files not working

Post by tuska »

For me there is a problem with the window width of the preview window which I have not yet noticed.
  1. Search query: files: ext:msg;txt
  2. I switch on the preview for an Outlook message that is longer than the maximised window is high
  3. The scroll bar in the preview window cannot be moved
  4. Only when I enlarge the preview window accordingly by dragging the arrow ⟺ on the left edge of the preview window
    the scroll arrow can be moved
  5. Although the preview window already takes up half(!) of the screen when the Everything window is maximised
    the preview window may freeze again when I click on the next .MSG file.
  6. Another effect was that after displaying an Outlook file (.msg) and clicking on a .TXT file
    the content of the .TXT file overlaid the content of the Outlook file(!)
  7. Further example: Preview window size = 50% of the maximised screen
    - Preview display for a .TXT file: OK
    - Preview display for a .MSG file (with text content larger screen): Scroll bar scrolls -> OK
    - Preview display for the next .MSG file (text content > screen): Scroll bar frozen -> Not OK
I think the error mainly occurs after using the preview for Outlook messages (.MSG), after clicking on a second [.MSG] file,
where the first Outlook message is larger than one screen page and the last file clicked on is also larger than one screen page.


However, this error can affect the preview for .TXT files or other file types afterwards.

Interestingly, the problem does NOT occur with the EML file extension
(although the text content has also exceeded one screen page).

___________________________________________________________________________
Tested with Everything-1.5.0.1368a.x64 up to and including Everything-1.5.0.1375a.x64 (then I stopped searching...)
Windows 11 Pro (x64) Version 23H2 (Build 22631.3527)
Microsoft® Outlook® LTSC MSO (16.0.14332.20678) 64-Bit (Part of: Microsoft Office LTSC Professional Plus 2021)
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

Thanks for the feedback,

I am seeing similar issues with the stock .msg preview handler.

This preview handler doesn't like the preview window from a different thread.

Earlier versions of Everything 1.5 used a preview window from the same thread.
This was changed in 1367a to help with Everything hanging when closing the preview window.

I will look into reverting this change and finding an alternative solution to the hanging.
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Preview .TXT files not working

Post by runmode »

Using version 1.5.0.1375a x64:

I was just about to post a bug report titled "After having previewed a PDF file, no other file types files can be previewed." when I found this thread.

Steps to reproduce the issue:
Searchfor some files file: ext:jpg|txt|pdf
highlite a JPG file -> preview is displayed (o.k.)
highlite a TXT file -> preview is displayed (o.k.)
highlite a PDF file -> preview is displayed (o.k.)
highlite a JPG file -> the preview of the previous PDF file remains (fault)
highlite another PDF file -> preview of that PDF is displayed (o.k.)
highlite a TXT file -> the preview of the previous PDF file remains, and it also happened that parts of the PDF get mixed with parts of the TXT file in the preview. (fault)

I need to restart Everything to preview other file types again, until I preview the next PDF file.
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Preview .TXT files not working

Post by horst.epp »

runmode wrote: Wed May 15, 2024 2:35 pm Using version 1.5.0.1375a x64:

I was just about to post a bug report titled "After having previewed a PDF file, no other file types files can be previewed." when I found this thread.

Steps to reproduce the issue:
Searchfor some files file: ext:jpg|txt|pdf
highlite a JPG file -> preview is displayed (o.k.)
highlite a TXT file -> preview is displayed (o.k.)
highlite a PDF file -> preview is displayed (o.k.)
highlite a JPG file -> the preview of the previous PDF file remains (fault)
highlite another PDF file -> preview of that PDF is displayed (o.k.)
highlite a TXT file -> the preview of the previous PDF file remains, and it also happened that parts of the PDF get mixed with parts of the TXT file in the preview. (fault)

I need to restart Everything to preview other file types again, until I preview the next PDF file.
Not confirmed
I can preview a mix of your extension and all previews are ok.
I guess you have some strange sort of preview modules in your System.
My previewers:
PDF = PDF-XChange Editor
TXT = Microsoft TXT Previewer
JPG = Windows 11 integrated
______________________________________________________
Windows 11 Home x64 Version 23H2 (OS Build 22631.3593)
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Preview .TXT files not working

Post by runmode »

I experimented with the ini setting:

/show_preview_handlers_in_preview_pane=1 ("allow") OR
/show_preview_handlers_in_preview_pane=0 ("system setting"):
Behaviour as described in my previous post

/show_preview_handlers_in_preview_pane=2 ("disallow"):
JPG files get previewed after PDF files (o.k., no issue!), BUT:
TXT files can not be previewed (although PerceivedType for .txt files is set to text)

Suggestions for the documentation here:
https://www.voidtools.com/support/every ... eview_pane
- Please mention that Everything needs to be restartet after settings changed
- Please could you be more verbose, because I don't understand:
Set to 1 to allow (what exactly?)
a) Allow Everything to use its own preview handler? or
b) allow system preview handlers in the preview pane? or
c) verbatim: generally show_preview_handlers_in_preview_pane ?
Set to 2 to disallow (what exactly?)
As my test displayed JPG files with setting=2, the meaning should be disallow Everything to use its own preview handler; but in this case I should see TXT previews, right?
Set to 0 to use the system setting (which can be found where?)
Is it the Windows Explorer option to show previews (or not) in general?
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Preview .TXT files not working

Post by runmode »

horst.epp wrote: Wed May 15, 2024 3:24 pm
I guess you have some strange sort of preview modules in your System.
My previewers:
PDF = PDF-XChange Editor
TXT = Microsoft TXT Previewer
JPG = Windows 11 integrated
Horst.epp, where can I check my previewers ?
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Preview .TXT files not working

Post by horst.epp »

runmode wrote: Wed May 15, 2024 3:45 pm
horst.epp wrote: Wed May 15, 2024 3:24 pm
I guess you have some strange sort of preview modules in your System.
My previewers:
PDF = PDF-XChange Editor
TXT = Microsoft TXT Previewer
JPG = Windows 11 integrated
Horst.epp, where can I check my previewers ?
A simple display is this cmd.
Run it, and it will add a list at the end of itself

Code: Select all

@Echo off
Echo/>>%0
Echo ============================================ >>%0
Echo Computername: %ComputerName% Date: %Date% %Time:~0,6% >>%0
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers" >>%0
More +9 <%0
Pause
goto :EOF
Looks like this
============================================
Computername: HOME-PC Date: 15.05.2024 18:12:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers
{13D3C4B8-B179-4ebb-BF62-F704173E7448} REG_SZ Windows Contact Preview Handler
{1531d583-8375-4d3f-b5fb-d23bbd169f22} REG_SZ Windows TXT Previewer
{53BEDF0B-4E5B-4183-8DC9-B844344FA104} REG_SZ Microsoft Windows MAPI Preview Handler
{8a7cae0e-5951-49cb-bf20-ab3fa1e44b01} REG_SZ Windows Font previewer
{92dbad9f-5025-49b0-9078-2d78f935e341} REG_SZ Microsoft Windows Mail Mime Preview Handler
{a42c2ccb-67d3-46fa-abe6-7d2f3488c7a3} REG_SZ Windows RTF Previewer
{b9815375-5d7f-4ce2-9245-c9d4da436930} REG_SZ Microsoft Windows Mail Mime Preview Handler
{BFD468D2-D0A0-4bdc-878C-E69C2F5B435D} REG_SZ Microsoft Windows Mail Html Preview Handler
{E64164EB-1AE0-4C50-BAEF-A413C2B3A4BC} REG_SZ Microsoft 3MF Shell Thumbnail and Preview Handler
{f8b8412b-dea3-4130-b36c-5e8be73106ac} REG_SZ Microsoft Windows Mail Html Preview Handler
{031EE060-67BC-460d-8847-E4A7C5E45A27} REG_SZ Windows Media Player Rich Preview Handler
{AD8855FB-F908-4DDF-982C-ADB9DE5FF000} REG_SZ Delphi Preview Handler
{37742665-fa1f-4da6-9c29-59fdfba13fd7} REG_SZ BrandsICT Msg Preview Handler
{3A84F9C2-6164-485C-A7D9-4B27F8AC009E} REG_SZ Microsoft PDF Previewer
{32a6a30d-c68e-4f7a-aa4c-2fa9011b0717} REG_SZ Foxit PDF Preview Handler
{9B68BDF7-95F9-4A1F-851C-27D822F8E3E9} REG_SZ PDF-XChange Preview Handler

For editing, I use the following tool from Microsoft (no longer on the Web)
Attachments
PreviewHandlerEditor-x64.zip
(90.18 KiB) Downloaded 441 times
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

horst.epp wrote: Wed May 15, 2024 4:14 pm A simple display is this cmd.
Run it, and it will add a list at the end of itself
Good tip!
Image Image

horst.epp wrote: Wed May 15, 2024 4:14 pm For editing, I use the following tool from Microsoft (no longer on the Web)
Very useful tool!
Image Image
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Preview .TXT files not working

Post by runmode »

horst.epp wrote: Wed May 15, 2024 4:14 pm "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers"
horst.epp wrote: Wed May 15, 2024 4:14 pm For editing, I use the following tool from Microsoft (no longer on the Web)
Thank you, this was great help! 8-)

Regarding PDF, I have two previewers, the "Adobe PDF preview handler" and the "Microsoft PDF Previewer", but the Preview Handler Association Editor discovered that none of them were associated with "*.pdf" . So I made use of the editor to create an association between the MS PDF Previewer and *.pdf.

Now previewing with Everything works as expected :D

Interestingly, previewing PDF worked before without this association.

BTW, what is the Windows previewer for JPG, TIF, PNG and suchlike? No preview handler in my list (also in your list) sounds from the naming as it would be responsible for still images.
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

runmode wrote: Wed May 15, 2024 8:37 pm Regarding PDF, I have two previewers, the "Adobe PDF preview handler" and the "Microsoft PDF Previewer", but the Preview Handler Association Editor discovered that none of them were associated with "*.pdf" . So I made use of the editor to create an association between the MS PDF Previewer and *.pdf.

Now previewing with Everything works as expected :D

Interestingly, previewing PDF worked before without this association.

...
Here, I have different scenario.
When previewing a PDF file, I got no preview, but just the icon for PDF files on preview pane.
Maybe that's because I have no preview handler listed by horst.epp's batch file.

Using Preview Handler Editor, I can't find an ADD button or something to add a new association.
In fact, there is no button at all, only check-boxes.

Questions:
1 - Is the program used by you the same zip file attached above?
2 - How to add a new association for PDF files?
3 - May I use Registry to create associations? If so, which key?

My handlers:

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers
    {b9815375-5d7f-4ce2-9245-c9d4da436930}    REG_SZ    Microsoft Windows Mail Mime Preview Handler
    {f8b8412b-dea3-4130-b36c-5e8be73106ac}    REG_SZ    Microsoft Windows Mail Html Preview Handler
    {92dbad9f-5025-49b0-9078-2d78f935e341}    REG_SZ    Microsoft Windows Mail Mime Preview Handler
    {BFD468D2-D0A0-4bdc-878C-E69C2F5B435D}    REG_SZ    Microsoft Windows Mail Html Preview Handler
    {a42c2ccb-67d3-46fa-abe6-7d2f3488c7a3}    REG_SZ    Windows RTF Previewer
    {1531d583-8375-4d3f-b5fb-d23bbd169f22}    REG_SZ    Windows TXT Previewer
    {13D3C4B8-B179-4ebb-BF62-F704173E7448}    REG_SZ    Windows Contact Preview Handler
    {8a7cae0e-5951-49cb-bf20-ab3fa1e44b01}    REG_SZ    Windows Font previewer
    {031EE060-67BC-460d-8847-E4A7C5E45A27}    REG_SZ    Windows Media Player Rich Preview Handler
    {53BEDF0B-4E5B-4183-8DC9-B844344FA104}    REG_SZ    Microsoft Windows MAPI Preview Handler
    {85862EDA-F507-4d5b-ACA9-BB2C34A85682}    REG_SZ    Microsoft XPS Rich Preview Handler
    {435fdba0-964c-43a7-8aff-cc94e21b2249}    REG_SZ    Microsoft Office Outlook MAPI Preview Handler
    {00020827-0000-0000-C000-000000000046}    REG_SZ    Pré-visualizador do Microsoft Excel
    {65235197-874B-4A07-BDC5-E65EA825B718}    REG_SZ    Pré-visualizador do Microsoft PowerPoint
    {84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}    REG_SZ    Pré-visualizador do Microsoft Word
Still on Windows 7...
(I know, it's old... Image )
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

Everything 1.5.0.1376a reverts to hosting the preview window in the same thread as the preview handler instance.
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Preview .TXT files not working

Post by tuska »

void wrote: Thu May 16, 2024 6:59 am Everything 1.5.0.1376a reverts to hosting the preview window in the same thread as the preview handler instance.
The problems I described here no longer exist in Everything 1.5.0.1376a (tested with x64).

Thanks for the prompt fix! :)
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Preview .TXT files not working

Post by runmode »

Gabarito wrote: Wed May 15, 2024 11:04 pm Questions:
1 - Is the program used by you the same zip file attached above?
2 - How to add a new association for PDF files?
3 - May I use Registry to create associations? If so, which key?
ad 1 - Yes, I unpacked the ZIP archive and run the exe. Windows Defender has found it to be save.

ad 2 - The instructions to use Stephen Toub's editor can still be found on the Microsoft site, while the download link is broken:
https://learn.microsoft.com/de-de/archi ... ion-editor
Briefly summarised, ticking the checkboxes toggles the related association on the fly. No GUI overload with buttons.

ad 3 - No need to dig through the internals explained here, if you have the editor:
https://learn.microsoft.com/en-us/windo ... ew-handler
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

runmode wrote: Thu May 16, 2024 7:41 pm ad 3 - No need to dig through the internals explained here, if you have the editor:
https://learn.microsoft.com/en-us/windo ... ew-handler
But I have no preview handler for PDF files.
So, I did the steps to register one.

Now, my preview pane is a black pane.
Before that, I had a PDF icon, not the preview.

Below, Registry keys after the tutorial.

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.pdf]
@="FoxitReader.Document"

[HKEY_CLASSES_ROOT\.pdf\OpenWithProgids]
"FirefoxHTML"=""

[HKEY_CLASSES_ROOT\.pdf\ShellEx]

[HKEY_CLASSES_ROOT\.pdf\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
@="{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}"

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}]
@="Fabricante do FoxitReader"
"DisplayName"="@FoxitReader.exe,-101"
"Icon"="Foxit Reader.exe,16"
"AppId"="{6d2b5079-2f0b-48dd-ab7f-97cec514d30b}"

[HKEY_CLASSES_ROOT\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\InprocServer32]
@="C:\\Program Files (x86)\\Foxit Software\\Foxit Reader\\Foxit Reader.exe"
"ThreadingModel"="Apartment"
"ProgId"=".pdf"
"VersionIndependentProgID"="Version IndependentProgID"
I'm not sure about an EXE file to COM classes. FoxitReader DLL doesn't seem the correct library. It doesn't even have an icon (Resource Hacker to explorer it).
So, I put CLSID for the ID of the Prevhost.exe surrogate host, as said in tutorial.

After that, I register it at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers.

Do you have ideas?

Thank you for your suggestions.
Gabarito
Posts: 77
Joined: Thu Apr 25, 2013 4:20 pm

Re: Preview .TXT files not working

Post by Gabarito »

void wrote: Thu May 16, 2024 6:59 am Everything 1.5.0.1376a reverts to hosting the preview window in the same thread as the preview handler instance.
Thanks for your great job, ever!

But I'm still looking for a solution for don't word wrap TXT or DOCX files.
Maybe a context menu inside the pane to toggle ON/OFF.
void
Developer
Posts: 16680
Joined: Fri Oct 16, 2009 11:31 pm

Re: Preview .TXT files not working

Post by void »

It's up to the preview handler to support disabling word wrap.

AFAIK, word wrap cannot be disabled in the stock txt preview handler.

Everything is just using the registered preview handler to render your previews.

I'm sure there's third party txt preview handlers out there that support disabling word wrap.

I want to add my own text preview handler at some stage with the option to word wrap.
runmode
Posts: 21
Joined: Sat May 27, 2023 11:22 pm

Re: Preview .TXT files not working

Post by runmode »

Gabarito wrote: Fri May 17, 2024 12:49 am But I have no preview handler for PDF files.
...
Do you have ideas?
I am really no expert for preview handlers, but my approach would be to install the free Adobe PDF reader (or similar PDF capable software) and hope that the installer will fix the problem.
Jolly
Posts: 17
Joined: Fri Oct 25, 2019 10:19 pm

Re: Preview .TXT files not working

Post by Jolly »

void wrote: Sat Mar 02, 2024 1:38 am However, the following did:

HKEY_CLASSES_ROOT\Unknown\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
Set the (default) value to the desired preview handler.
This preview handler will be used as a fallback in Windows Explorer.

"Unknown" is a special "PerceivedType".
There are other PerceivedTypes: audio, image, system, text and video.
The preview handler for these types can be set under:
HKEY_CLASSES_ROOT\SystemFileAssociations\PerceivedType\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
This works for me! :D
codenation
Posts: 4
Joined: Sun Dec 01, 2019 6:22 pm

Re: Preview .TXT files not working

Post by codenation »

codenation
Posts: 4
Joined: Sun Dec 01, 2019 6:22 pm

Re: Preview .TXT files not working

Post by codenation »

runmode wrote: Thu May 16, 2024 7:41 pm
Gabarito wrote: Wed May 15, 2024 11:04 pm Questions:
1 - Is the program used by you the same zip file attached above?
2 - How to add a new association for PDF files?
3 - May I use Registry to create associations? If so, which key?
ad 1 - Yes, I unpacked the ZIP archive and run the exe. Windows Defender has found it to be save.

ad 2 - The instructions to use Stephen Toub's editor can still be found on the Microsoft site, while the download link is broken:
https://learn.microsoft.com/de-de/archi ... ion-editor
Briefly summarised, ticking the checkboxes toggles the related association on the fly. No GUI overload with buttons.

ad 3 - No need to dig through the internals explained here, if you have the editor:
https://learn.microsoft.com/en-us/windo ... ew-handler
https://web.archive.org/web/20140421054 ... Editor.zip
Jolly
Posts: 17
Joined: Fri Oct 25, 2019 10:19 pm

Re: Preview .TXT files not working

Post by Jolly »

Gabarito wrote: Fri May 17, 2024 12:49 am But I have no preview handler for PDF files.

Do you have ideas?
Microsofts Power Toys has a number of good preview handlers, including for code, markdown, and pdf.
https://github.com/microsoft/PowerToys? ... -powertoys

https://learn.microsoft.com/en-us/windo ... e-explorer
Post Reply