Custom Windows 7 Preview Pane syntax highlighting

2019-03-20 02:24发布

问题:

After discovering on superuser that there is no current way to add syntax highlighting to the Windows 7 preview pane, I figured if someone else hasn't done it yet then I'll go ahead and do it myself.

Is there an API or SDK available for Windows 7 that exposes the preview pane in explorer to customization? If so, what is it and how do you think is the most elegant way to accomplish this? I would like it to read the syntax highlighting options from Visual Studio to get the users favorite colors and code theme settings.

回答1:

You must check the Preview Handler, you can download an example from here. The Preview Handler is used to display a file preview inside the Windows Explorer preview pane or other preview handler hosts.

You can check these links :

  • IPreviewHandler Interface
  • View Data Your Way With Our Managed Preview Handler Framework
  • Using Vista Preview Handlers in WPF application