Color coded Windows 7 Preview Pane?

14

9

Customizing what files you can preview is cool, but is there a way to create a custom preview extension to add syntax highlighting? I have many .h, .c, .cpp, .cs and .java files on my windows machine and it would be nice to have the syntax highlighting available via explorer's new preview pane.

slf

Posted 2009-11-06T14:37:35.310

Reputation: 379

Answers

1

Currently it is not available and there is no add-on I can find anywhere. It has been discussed and commented about so no doubt there is demand for it. I expect an extension to come out soon.

John T

Posted 2009-11-06T14:37:35.310

Reputation: 149 037

It's not because it's discussed and commented that it will be released soon? Unless you're busy on it now ;-) . It would be easier, I think, if they could reuse the editing component of a syntax-highlighting editor like PSPad, Textpad, Notepad++, ... – Snark – 2009-11-06T17:16:49.013

I said I "expect". Not "it will". – John T – 2009-11-06T17:43:25.670

Hum, then I'll need to check my En-Fr dictionary again for the meaning of "to expect" :-/ – Snark – 2009-11-06T19:03:30.297

7

I know the question is old. But just as other can benefit from my search I just found out a good preview handler.

https://github.com/RRUZ/delphi-preview-handler

It handles many types like c,c++,c#,.asm, and others. Plus it has support for themes.

rxantos

Posted 2009-11-06T14:37:35.310

Reputation: 211

7

Just found this that supports the formats below:

http://www.smartftp.com/client/addons/sourcepreview

ActionScript (.as, .mx)
ASP (.asp)
ASPX (.aspx)
AutoIt (.au3)
Bash (.sh, .bsh)
Batch (.bat, .cmd)
Caml (.ml, .mli, .sml, .thy)
C (.c)
C++ (.cpp, .cxx, ,.cc, .h, .hxx, .rgs)
C# (.cs)
CSS (.css)
Diff (.diff, .patch)
Fortran (.f, .for, .f90, .f95, .f2k)
Ini (.ini, .inf, .reg, .url)
Inno Setup (.iss)
Java (.java)
JavaScript (.js)
Lisp (.lsp, .lisp)
Makefile (.mak)
Matlab (.m)
NFO (.nfo)
NSIS (.nsi, .nsh)
Pascal (.pas, .inc)
Perl (.pl, .pm, .plx)
PHP (.php, .php3, .phtml)
Python (.py, .pyw)
Resource (.rc)
Smalltalk (.st)
TeX (.tex)
SQL (.sql)
VB (.vb)
VBScript (.vbs)
XML (.xml, .xsd, .xsml, xsl, .kml)

Steve Brooks

Posted 2009-11-06T14:37:35.310

Reputation: 71

5-1, you cannot try before you buy (actually I didn't vote) – Kerridge0 – 2013-08-16T14:33:25.900

3

There is a Code Preview Handler, but it supports only the extensions .cs, .vb, .js and .sql . The source code is available and it doesn't look too complex to create a Preview Handler (well, sort of, I wouldn't know how to do one).

I tried adding other extensions to the Code Preview Handler with the tool Preview Handler Editor but it doesn't work, the preview pane is blank (at least for the .pl files I tried).

alt text

Edit: you have also a pack of Preview Handlers here, that support the following filetypes:

* ActionScript (.as) 
* ASPX (.aspx)
* C# (.cs)
* CSS (.css)
* Diff (.diff, .patch)
* DOS (.bat, .cmd)
* JavaScript (.js)
* Ruby (.rb, .rhtml, .rjs) thanks to Ivan Porto Carrero
* SQL (.sql)
* VB (.vb)

Snark

Posted 2009-11-06T14:37:35.310

Reputation: 30 147

Many links on timheuer.com are broken. Source code is no longer available. Even the sources he referenced are not available any more (e.g. HtmlApp). – Thomas Weller – 2015-04-28T21:28:44.170

Perfect for what I needed, and almost nothing to configure! Just run it and it works. Thanks. – MAW74656 – 2013-11-06T22:42:07.363

2

There's an extension that supports many common coding formats here: http://blog.tatham.oddie.com.au/2006/12/20/vista-and-office-2007-preview-handler-pack-released/

Tatham Oddie

Posted 2009-11-06T14:37:35.310

Reputation: 181

1

This msdn article is available as well. There seems to be enough info there to do anything we've discussed here.

slestak

Posted 2009-11-06T14:37:35.310

Reputation: 101