[Solution] Acceleration of GUI interface on the non-Aero themes of Windows 7

Acceleration of GUI interface on the non-Aero themes of Windows 7

A complete set of solutions dated December 7, 2019, consisting of a new version of the Aero theme “Classic AE mod 2019_8”, a patch for the dwm.exe file, and a set of programs to accelerate the user interface, including the source code (all that was achieved for over 2 years).

Description of the problem:
Acceleration of the graphical interface in Windows 7 is used only when working in Aero themes, and is disabled in all basic themes, including the Classic one. Therefore, all the interface elements in the Aero theme - are drawn by the GPU (graphics card), and in the classic theme - by the CPU (central processor). When user has a fast graphics card (newer than 2010), the Aero themes work much more productively than Classic theme. The problem is worsened by the fact that some driver developers, such as AMD - are reckless about the implementation of 2D GDI functions in the Radeon drivers, newer than 2014 (since v15.7 untill the latest v19.12.2, in absolutely all versions), which further slows down the work of the Classic theme. The Classic theme worked fast only in Windows 98/2000/XP, but in Windows 7 it is badly.

In games, FPS will not increase. Games use 3D-functions, they always work with the graphic acceleration. The growth should be expected in 2D applications + GUI windows, all elements of interface will be drawn/scaled/moved/overlapped much faster, without slowing down and blinking text. In this case, the graphic processor, unloading the central processor for other tasks.

Remedies to solve the problem:
1) To use the classic theme in the Aero-wrapper “Classic AE mod 2019_8” - this is an analogue of the Classic theme (by appearance), but made in the form of an Aero theme (by properties). This Aero theme uses the resources of the graphics processor of the video card, and works many times faster than the built-in Classic one. This is by far the best and most bug-free solution.
2) To patch Windows 7 (dwm.exe file), and force graphic acceleration on the non-Aero themes. The directory “Patch dwm.exe” has been added, with a description of the method for enabling graphic acceleration through patching a system file. Also included are ready-made patched binaries for 32-bit and 64-bit OS editions, as well as recommendations with a bat-file for automating theme switching and the Explorer.exe restart.
3) In addition, a set of programs is attached, that allow to bring the fonts in the dialogs, the Start menu and the taskbar to the correct classic appearence, as well as the classic skin for the ClassicShell program, made as a likeness to the theme color of “Classic AE mod 2019”. The archive contains a set of programs for demonstrating glitches of the Classic theme, and for comparison of the OS running with graphic acceleration and without it.
4) Other solutions - DWM Composition program, a switch for WS_EX_COMPOSITED style, classtm.dll library.

DWM Composition program - allows to enable/disable the composition (GPU acceleration) in Aero themes on-the-fly.

Unfortunately, it cannot enable acceleration and solve our problem, but it clearly demonstrates how important graphic acceleration is. The main functionality are buttons “Enable composition” and “Disable composition” , turning the graphical acceleration “on” and “off” immediately. Source code is attached.

A switch for WS_EX_COMPOSITED style - are two programs for turning “on” and “off” the WS_EX_COMPOSITED style, which allows you to force the double buffering, which leads to faster 2D video output (especially noticeable on problematic Radeon drivers). A program is without a GUI, enables and disables the style just at startup. The program causes many glitches, and is not suitable for permanent operation. Source code is attached.

Classtm.dll library. The classtm.dll file must be put into c:\Windows\System32, which will be loaded up through the registry key Appinit_Dlls . For x86 and x64 systems, there are separate files. There is a demo in a window TestLVS.exe, but for all other applications, enabling of acceleration only works through classtm.dll. Loading of the library through the classtm_dll_ON.reg registry file, return to the system settings - classtm_dll_OFF.reg . After importing the reg-file, reboot of the PC is mandatory.

Breaker for it - an empty file in the root of the drive C:\classtm (it is enough to rename the file, rather then delete/move). Do not be surprised, the windows “My Computer, Personalization, Trash Bin” - will stop working, as other windows of Explorer. Other applications will be launched with graphic acceleration in a Classic theme, though with a spoiled color scheme. Side effects - some windows turn into classic ones, and some remain in Aero style. The source of the dll library is attached.


1-st solution - theme "Classic AE mod 2019_8"

Classic theme for Windows 7 with GPU acceleration “Classic AE mod 2019_8” (December 07, 2019)
This theme based on “Classic AE 2.5.3” https://saarineames.deviantart.com/art/C…Final-343638171

Complete list of modifications:
1) Added a gradient to the window title
2) The correct color of the text in the active and inactive window titles
3) Normal Tahoma-font (without ClearType)
4) The correct gray color in all elements of the interface RGB (212, 208, 200)
5) Correct TrackBar
6) Classic menu (fixed color)
7) For a better view, the highlighted item on a gray background is darker than on a white
8) ProgressBar animation is disabled
9) No-skins cursors are used
10) Fixed a bug in ScrollBar
11) Fixed background color Windows Firewall
12) Fixed aero mode crach at 125% font size
13) Darker active window title in non-aero mode
14) Correct resource IMAGE#1136
15) Fixed text captions (white field in Outpost)
16) Small bugs are fixed in the programs BitComet and FireFox
17) Added archive of old versions of themes from mod_2018 to mod_2019_7
18) TaskManager and Calculator with a classic design are attached,
and additional programs recommended for use:
- 7tt_setup - very useful tweaker of the TaskBar
- ClassicShellSetup_4_3_1-ru - for classic “Start” menu
- FONTS_140516 - replaces the font Segoe 9 with Tahoma 8 in all dialogs
- Win7 Style Builder v1.5.0.0 - msstyles file editor, if you want to modify this theme

The rendering options for the theme:
- Themes (with ClearType font)
- Themes (regular font)
For users who want the bold (smooth) fonts - install “Classic AE mod 2019_8 (ClearType)”. If you prefer narrow (classic, non-smoothed) fonts, then install the usual version of “Classic AE mod 2019_8”.

Installation of the theme:
1) Install “UniversalThemePatcher” (Recommended) or “UxStyle” for your Windows 7 (32- or 64-bit). If “UniversalThemePatcher” or “UxStyle” is already installed - then this step is skipped. This patch allows you to add third-party themes to your system.
2) Unpack the theme “Classic AE mod 2019_8” in the path c:\WINDOWS\Resources\Themes<br />3) Go to “Personalization” and switch to "Classic AE mod 2019_8"
4) Restart your PC. Enjoy the classic design Windows 7 with GPU acceleration!

Verification of the theme installation:
It is easy to check the correctness of the installation - just look at the appearance of the “minimize/ maximize/ close” buttons in the window title. If the “close” button has become wider than the rest (as in the screenshot) - then everything was installed fine! If the buttons remained the same width, then the Aero mode was not enabled, and the theme works in the basic mode (without acceleration). This is most often due to the absence of a patch by “UniversalThemePatcher” or “UxStyle”, that allows third-party themes to use Aero mode. Look at the file "Verification of the theme installation.png"

The theme exists in two versions (with regular and ClearType fonts), and as of December 2019 is the best substitute for the built-in Classic. All resources/settings of the theme are in the file “Classic AE mod 2019_8\aero.msstyles”. You need to edit the msstyles file with the program “Windows Style Builder” from the archive. If you will get a better result - please post it to us!

2-nd solution - a patch for dwm.exe (by “El Sanchez”)

DWM is a window manager in OS Windows, and as previously was described, the on/off switch for graphic acceleration is implemented in it. System instability when using patched DWM was not detected.

To see the result, you need to consider 2 nuances:
1) The patch does not enable composition, but it doesn’t disable composition when switching from Aero-themes to the Classic. After switching, the interface changes to Classic, but the window title continues to look like the theme from which it was switched. If to restart the PC, then on the newly loaded classic theme - acceleration no longer works; in short, the fact of switching the theme (Aero → Classic) is important.
2) After switching to the Classic, the look of the taskbar deteriorates - it becomes pale and translucent. If to restart the Explorer process, then the color will return to normal.

The procedure for applying the patch:
1) Do patch the DWM.EXE file or extract the ready one from the archive (considering the OS bitness)

2) Replace the patched dwm.exe file in your OS. To do this, you need to boot under another OS or from a boot disk, flash drive - in general anyhow, to replace the system file.
3) Now let’s boot with the AERO-theme, on the built-in or any other, it is important that the theme must be with the properties of AERO, and that it works with the enabled composition.
4) Switch to the classic theme. Acceleration/composition remains working.

Ready binary for Windows 7 SP1:
dwm.exe - patched DWM; dwm_orig_x64.exe - original file (in case of rollback, rename to dwm.exe)
Ready binary for (x86) system:
dwm.exe - patched DWM; dwm_orig_x86.exe - original file (in case of rollback, rename to dwm.exe)

The user “WatsonRus” has proposed a bat-file for automating the process of switching themes using the program “Theme Switcher” and restarting the Explorer. Program description - https://www.white-windows.ru/theme-switc…mandnoj-stroki/
Download Theme Switcher - https://winaero.com/download.php?view.55

Text of the bat-file:
@echo off
ThemeSwitcher.exe win7classic
Taskkill /f /im explorer.exe
start %windir%\explorer.exe

You need to save the original classic gray theme into the file “win7classic.theme”, and put the file into the “Themes” folder - c:\WINDOWS\Resources\Themes. You can make a timeout before switching, by adding before the ThemeSwitcher a command / T N , where N are seconds of delay.

Big thanks to “El Sanchez” for the work done. The patch is not completed yet, but it 100% demonstrates the main thing - acceleration in the Classic theme can be returned. If there are programmers on the forum, then please help in perfecting the result. It is also necessary to make sure that acceleration initially works when the PC is restarted and the taskbar does not change its appearance, without restarting the Explorer. A more correct patch is needed.

Download archive with solutions (zip, 24 MB):

It does not depend on the productivity of the PC, even on a modern computer, with a powerful CPU and GPU, you will get problems with 2D performance in any non-Aero themes. To check, do download a simple program, for example - 2ip NetMonitor from the website https://2ip.ru/download/NetMonitor.exe and become assured that without the DWM patch on the Classic theme - all lines will flicker. But with the DWM patch, the lags disappear.

Similar problems will occur on other programs that do not use double buffering of video output. Another example is the simplest Neutron 1.07 program, you can download it from https://neutron.ru.uptodown.com/windows/download or take it from the “Solutions” archive from this topic. Even in the “Task Manager” (built-in from Win 7), the column “CPU load” flashes. There are a lot of such examples…

All cases are united by a trait - programs that do not use double buffering of video output will work slowly in any non-Aero themes (including built-in Classic). Enabling composition through the DWM.EXE patch forces double buffering, and significantly increases 2D GDI performance - removing blinking text labels and speeding up drawing of a 2D interface up to 10 times!!!