• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Photoshop filter plugin: How are Visual Themes enabled?

Community Beginner ,
Dec 09, 2018 Dec 09, 2018

Copy link to clipboard

Copied

Hello,

Looking at some very old plugins, I was wondering why some plugins had Visual Themes enabled (i.e. their dialogs have normal WinXP/Vista/Win7/... buttons) while others have not (i.e. Windows 9x buttons).

Let's say there are two filter plugins :

  • OldFilter.8bf without Visual Themes
  • NewFilter.8bf with Visual Themes

So I did some experiments:

1. NewFilter.8bf has an XP Manifest ressource, while OldFilter.8bf does not. So, my first idea was to simply add a Manifest ressource to OldFilter.8bf using a Resource Editor. But that did not work: The controls are still in Windows 9x style. I double checked that the manifest is valid and correctly added to the 8BF DLL.

2. I checked the PE header flags of the 8BF files. Both have the fields MajorOperatingSystemVersion/MinorOperatingSystemVersion set to 4.00 (i.e. they are Win95 compatible plugins, not Win3.11 plugins)

3. In the MSDN​ I have read that an application can disable Visual Themes by calling SetWindowTheme(hWnd, L" ", L" ")

As a small test, I have edited Photoshop.exe with an hex editor and replaced the string "SetWindowTheme" with something else, e.g. "XXXWindowTheme", so that the WinAPI call will fail. Et voilà: OldFilter.8bf has now Visual Themes enabled (or better to say: It has its themes not disabled)

Of course, this is not an acceptable solution, since I don't want to have a modified Photoshop.exe, and invalidate this WinAPI function call might cause thousand other side effects, and it affects all plugins.

My understanding of what is going on is: When Photoshop.exe calls the filter plugin, it somehow checks if this plugin is able to handle Visual Themes. If Photoshop.exe does not think that the plugin is able to, it will call SetWindowTheme to disable Visual Themes, in order to reach a good backwards compatibility.

Now the question is, how does Photoshop.exe detect it? Are there some compatibility flags inside the 8BF file, or is there a special callback function to query compatibility flags?

TOPICS
SDK

Views

578

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Dec 25, 2018 Dec 25, 2018

I can answer my own question.

It turns out that Photoshop 7 disabled the Themes for all filter plugins if they are called in "filter" mode (but not if called in "about window" mode). So, even a HelloWorld plugin will have Win9x style buttons, even if a manifest is present in the 8BF. There is no way to get visual themes, except if you do explicitly perform WinAPI calls yourself.

Newer versions of Photoshop don't do that. So, the plugins will look okay in newer versions, having visual theme buttons

...

Votes

Translate

Translate
Adobe
Community Beginner ,
Dec 25, 2018 Dec 25, 2018

Copy link to clipboard

Copied

LATEST

I can answer my own question.

It turns out that Photoshop 7 disabled the Themes for all filter plugins if they are called in "filter" mode (but not if called in "about window" mode). So, even a HelloWorld plugin will have Win9x style buttons, even if a manifest is present in the 8BF. There is no way to get visual themes, except if you do explicitly perform WinAPI calls yourself.

Newer versions of Photoshop don't do that. So, the plugins will look okay in newer versions, having visual theme buttons. (But also there, the manifest is ignored).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines