Display AHK file content within Explorers Preview Pane

Post your working scripts, libraries and tools
Posts: 3100
Joined: 13 May 2014, 17:15

Display AHK file content within Explorers Preview Pane

12 Jun 2017, 03:42

bc I have been constantly annoyed that AHK's file content hasn't been displayed within Windows Explorers preview pane I asked my ol' pal Google for advice.
sHe showed up with this: https://kickthatcomputer.wordpress.com/ ... xtensions/
So I started AHK rocket sciencing to end up with this coding masterpiece ... that you have to use @ your own risk :twisted:
Perceived types, defined as PerceivedType values, are similar to file types except that they refer to broad categories of file format types rather than specific file types. For example, image, text, audio, and compressed are perceived types. File types (generally public file types) can be assigned a perceived type, and should always be assigned one whenever there is one that is appropriate. For example, the image file types .bmp, .png, .jpg, and .gif are also of perceived type image.

The default perceived types are as follows:
  • Folder
https://msdn.microsoft.com/de-de/librar ... eivedtypes
Another option, taken from [here] ...
To view HTML files as text in the preview pane use this registry patch (save with a .reg extension and double-click):

Windows Registry Editor Version 5.00

Bonus: preview any file type without a preview handler as plain text:

Windows Registry Editor Version 5.00

Keep on coding :thumbup:
Posts: 28
Joined: 01 Oct 2013, 21:27

Re: Display AHK file content within Explorers Preview Pane

06 Dec 2017, 11:12

I had never heard of preview handlers until today. After plenty of googling and bouncing around, I ended up figuring out the same thing you did regarding registering a preview handler for .ahk files. Too bad I didn't first google if someone had already figured this out! :roll:

Thank you for posting your finds, though. I never knew I wanted this, but I sure do now! :D
User avatar
Posts: 84
Joined: 05 Dec 2016, 06:26

Re: Display AHK file content within Explorers Preview Pane

07 Dec 2017, 01:26

i have some reg files i run any time i get a new computer https://gist.github.com/davebrny/d88e0f ... c4f7c73bd2

i never thought of using the regWrite command though. that could save me a few clicks!
User avatar
Delta Pythagorean
Posts: 562
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: Display AHK file content within Explorers Preview Pane

09 Dec 2017, 20:14

Awesome! :thumbup:

I think this topic should be moved to tutorials just for what the purpose is for this topic.

- [AHK].......: Unicode 64-bit
- [OS].........: Windows 10.0.18362
- [GITHUB]...: github.com/DeltaPyth
- [PAYPAL]....: paypal.me/DelPyth
- [DISCORD]..: Delta#3324

Remember to use [code]CODE[/code] for your multi-line scripts.
Stay safe, stay inside, and remember to wash your hands for 20 seconds!
User avatar
Posts: 92
Joined: 27 Oct 2014, 20:49
GitHub: Megnatar
Location: The Netherlands

Re: Display AHK file content within Explorers Preview Pane

02 Apr 2018, 03:18

Here is the reg key I'm using since ages to enable preview for .ahk file type.

Save as type:

Code: Select all

Windows Registry Editor Version 5.00


Return to “Scripts and Functions”

Who is online

Users browsing this forum: boiler, g1zm02k, sikongshan, SpeedMaster and 22 guests