Solved

Messages

Posted on 2000-04-15
4
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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