Solved

Messages

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

624 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