Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 782925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:27:49+00:00 2026-05-14T20:27:49+00:00

i need to know when my application recieves a WM_SETTINGCHANGE message (formerly known as

  • 0

i need to know when my application recieves a WM_SETTINGCHANGE message (formerly known as WM_WININICHANGE).

Problem is that the message pump in TApplication sends it down a black hole (default handler) before i can get a chance to see it:

procedure TApplication.WndProc(var Message: TMessage);
...
begin
   Message.Result := 0;

   for I := 0 to FWindowHooks.Count - 1 do
      if TWindowHook(FWindowHooks[I]^)(Message) then Exit;

   CheckIniChange(Message);

   with Message do
      case Msg of
      WM_SETTINGCHANGE:
         begin
            Mouse.SettingChanged(wParam);
            Default;   <----------------------*poof* down the sink hole
         end;
      ...
      end;
      ...
end;

The procedure CheckIniChange() doesn’t throw any event i can handle, neither does Mouse.SettingChanged().

And once the code path reaches Default, it is sent down the DefWindowProc drain hole, never to be seen again (since the first thing the WndProc does is set the Message.Result to zero.

i was hoping to assign a handler to a TApplicationEvents.OnMessage event:

procedure TdmGlobal.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
begin
   case Msg.message of
   WM_SETTINGCHANGE:
      begin
         // Code
      end;
   end;
end;

But the OnMessage event is only thrown for messages that come through the message pump. Since the WM_SETTINGCHANGE message is “handled”, it never sees the

PeekMessage
TranslateMessage
DispatchMessage

system.

How can i respond to the windows broadcast WM_SETTINGCHANGE?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:27:50+00:00Added an answer on May 14, 2026 at 8:27 pm

    Edit2: For older versions the usual message intercept should work…

    [...]
      private
        procedure WMSettingChange(var Message: TWMSettingChange); message WM_SETTINGCHANGE;
    [...]
    procedure TForm1.WMSettingChange(var Message: TWMSettingChange);
    begin
      showMessage('SettingChange message intercept');
    end;
    

    Edit: Ooops! Did not see it was for D5. The following was in D2007+.

    Use an OnSettingChange in your Application:

    procedure TApplication.SettingChange(var Message: TWMSettingChange);
    begin
      if Assigned(FOnSettingChange) then
        with Message do
          FOnSettingChange(Self, Flag, Section, Result);
    end;
    

    You can test with this code. Try and change the height or docking side of the TaskBar…

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Application.OnSettingChange := MySettingChange;
    end;
    
    procedure TForm1.MySettingChange(Sender: TObject; Flag: Integer;
      const Section: string; var Result: Integer);
    begin
      showMessage('setting changed');
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know what internet connection is available when my application is running.
I need to know how I can detect the current application pool I am
I am developing a GPL-licensed application in Python and need to know if the
Being a application developer, do I need to know Unicode?
I need to know about Epoll On linux System. Could you recommend manual or
I need to know how the performance of different XML tools (parsers, validators, XPath
I need to know how much space occupies all the databases inside an SQL
I need to know how to turn on Code Coverage when running TFS builds
I need to know when the memory will be allocated for a particular program.
I need to know, from within Powershell, if the current drive is a mapped

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.