Solved

Messages

Posted on 2000-04-15
4
295 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Machine not responding during CopyFile() 3 104
Delphi XE10, MySQL Query 4 167
Internet Explorer View Settings Question 15 117
Dev Express grid collapse 2 45
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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