0
votes

I have a VB6 SP6 application using a Graph (GRAPH32.OCX). It runs fine as long as Windows is set to classic theme, but strange scaling and clipping occurs in any other modes, e.g. Windows XP theme on Windows XP or Aero theme on Windows 7.

Here's how it looks like:

Clipped graph

I have tried the following:

  • disabling themes for my application
  • setting compatibility to any of the older operating systems

How could I solve this issue, except migrating to other chart control like MSChart?

1

1 Answers

0
votes

It seems that the graphics server (GSW32.exe) which draws the graph also gets the settings from its own process. Disabling the themes for GSW32.exe helped on WIndows XP. On Windows Vista and Windows 7, themes need to be disabled on the own application in addition. The latter setting broke Windows XP again, so it needs to be set only on Vista and 7.

Long text, short story: to make this setting by an installer, you can derive from the following InnoSetup commands.

;Disable themes on graphics server
Root: HKLM32; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: String; ValueName: "{syswow64}\GSW32.exe"; ValueData: "DISABLETHEMES";
Root: HKLM64; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: String; ValueName: "{syswow64}\GSW32.exe"; ValueData: "DISABLETHEMES"; Check: IsWin64;
;Disable themes on own application, needed on Windows 7 only, must not be enabled on XP or Vista
Root: HKLM32; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: String; ValueName: "{app}\{#MyAppExeName}"; ValueData: "DISABLETHEMES"; MinVersion: 6.1.7600
Root: HKLM64; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; ValueType: String; ValueName: "{app}\{#MyAppExeName}"; ValueData: "DISABLETHEMES"; MinVersion: 6.1.7600; Check: IsWin64;