TC flickering when changing Windows desktop background wallpaper (+fix)

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Erik-DJ
Junior Member
Junior Member
Posts: 39
Joined: 2007-09-15, 14:53 UTC
Location: Noord-Brabant, The Netherlands

TC flickering when changing Windows desktop background wallpaper (+fix)

Post by *Erik-DJ »

When changing the Windows desktop background wallpaper (photo/image), TC starts to flicker for about a second or two. It's annoying because I have an automatic background changer every few hours. You can fix this in Delphi with the following code (from https://www.heidisql.com/forum.php?t=19141&cookie_consent=1):

Code: Select all

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private-Deklarationen }
    function HookMainWindow(var Message: TMessage): Boolean;
  public
    { Public-Deklarationen }
  end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.HookMainWindow(HookMainWindow);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Application.UnhookMainWindow(HookMainWindow);
end;

function TForm1.HookMainWindow(var Message: TMessage): Boolean;
const
  WM_SETTINGCHANGE_OFFSET = 8 * WM_USER;
begin
  Result := False;
  if WM_SETTINGCHANGE = Message.Msg then
  begin
    case Message.WParam of
      // Add the setting flag here that triggered the flickering.
      0, 1, SPI_SETMOUSETRAILS, SPI_SETMOUSE, SPI_SETMOUSESPEED:
        begin
          // Do not eat the message, instead hide it from the normal handling by adding
          // an offset. That way it remains possible to catch those messages by the
          // normal message handler methods.
          Inc(Message.Msg, WM_SETTINGCHANGE_OFFSET);
        end;
    end;
  end;
end;
Thanks. Windows 10 pro x64. Darkmode TC x64 v10.52.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: TC flickering when changing Windows desktop background wallpaper (+fix)

Post by *Horst.Epp »

Its not a real problem for most users.
I guess your suggestion doesn't help as x64 TC is not written in Delphi
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Re: TC flickering when changing Windows desktop background wallpaper (+fix)

Post by *Sir_SiLvA »

Horst.Epp wrote: 2022-12-01, 17:10 UTC I guess your suggestion doesn't help as x64 TC is not written in Delphi
AFAIK it IS as "Lazarus is a Delphi compatible cross-platform IDE for Rapid Application Development".
Hoecker sie sind raus!
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: TC flickering when changing Windows desktop background wallpaper (+fix)

Post by *Fla$her »

Erik-DJ wrote: 2022-12-01, 11:09 UTCWhen changing the Windows desktop background wallpaper (photo/image), TC starts to flicker for about a second or two.
I often use the wallpaper changer script, I've never noticed this. Checked on 10.52 x32/x64, there is no flicker.
Overquoting is evil! 👎
Post Reply