Solved

Messages

Posted on 2000-04-15
4
293 Views
Last Modified: 2010-04-04
I have two questions about message

When the default home page changed in IE, which message will be sent? And I how to get it?

When the wallpaper changed, which message willb be sent? And I how to get it?

0
Comment
Question by:cookey
  • 2
4 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2719384
No messages are sent for either of the events you asked.

There is, however, a way to monitor changes in both wallpaper and the IE default hp: Monitor the activity in the Registry and, if the changes are made to the keys where that information reside, you know the user (or another program) has changed the wallpaper or the default HP.

Yours,

Alex
0
 
LVL 3

Accepted Solution

by:
f15iaf earned 20 total points
ID: 2736409
you can get a message then wallpaper changes

the messge is
WM_SETTINGCHANGE          
 
  wParam = SPI_SETDESKWALLPAPER  
  lParam = pointer to new bitmap file.

you can get this message using this

Trapping messages
 
 Topic groups
 
 Under some circumstances, you might want your components to ignore messages. That is, you want to keep the component  from dispatching the message to its handler. To trap a message, you override the virtual method  WndProc .
  The  WndProc  method screens messages before passing them to the  Dispatch  method, which in turn determines which method  gets to handle the message. By overriding  WndProc , your component gets a chance to filter out messages before dispatching  them. An override of  WndProc  for a control derived from  TWinControl  looks like this:
 
 procedure  TMyControl.WndProc( var  Message: TMessage);
 
 begin
    { tests to determine whether to continue processing }
     inherited  WndProc(Message);
  end ;
 
 The  TControl  component defines entire ranges of mouse messages that it filters when a user is dragging and dropping controls.  Overriding  WndProc  helps this in two ways:  
 
         It can filter ranges of messages instead of having to specify handlers for each one.
          It can preclude dispatching the message at all, so the handlers are never called.
 
example:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)

  private
    { Private declarations }
  public
    procedure wndproc(var mes:Tmessage);override;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure Tform1.wndproc(var mes:Tmessage);
begin
        if(mes.msg=WM_SETTINGCHANGE)and(mes.wparam=SPI_SETDESKWALLPAPER)then
        begin

        end;
end;

end.
 
   

0
 

Author Comment

by:cookey
ID: 2737154
There are my codes:

type
  TForm1 = class(TForm)
   .....
  private
    procedure SettingCh(var Mes: TWMSETTINGCHANGE); message WM_SETTINGCHANGE;
......

procedure TForm1.SettingCh(var Mes: TWMSETTINGCHANGE);
begin
  inherited;
  Showmessage(IntToStr(Mes.Flag));
end;

but, nothing happend when the wall paper has been changed, no any message has been shown. where is the mistake?

0
 

Author Comment

by:cookey
ID: 2737158
There are my codes:

type
  TForm1 = class(TForm)
   .....
  private
    procedure SettingCh(var Mes: TWMSETTINGCHANGE); message WM_SETTINGCHANGE;
......

procedure TForm1.SettingCh(var Mes: TWMSETTINGCHANGE);
begin
  inherited;
  Showmessage(IntToStr(Mes.Flag));
end;

but, nothing happend when the wall paper has been changed, no any message has been shown. where is the mistake?

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Path  to current project in Delphi. 2 71
Delphi : could not find program, '...exe' 2 145
Delphi - replicating a form 8 62
Firemonkey DbLookupComboBox equivalent ? 2 32
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now