Solved

HOW TO KNOW WHEN THE USER CHANGE THE WALLPAPER

Posted on 2006-07-02
2
235 Views
Last Modified: 2010-04-05
I WOULD LIKE TO KNOW WHEN THE USER CHANGE THE WALLPAPER, AFTER THAT:

SHOW MESSAGE TO HIM THAT SAYS LIKE " YOU CAN NOT CHANGE THE WALL PAPERT"

AND FINALLY, CHANGE TO MY OWN WALLPAPER.
0
Comment
Question by:rafaelrgl
[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 Comments
 
LVL 3

Accepted Solution

by:
Ubethatway earned 500 total points
ID: 17028643
To disable the user from being able to change the wallpaper you need to use the registry. See this article for instructions:

http://delphi.about.com/od/windowsshellapi/l/aa081703a.htm

Alternatively, if you dont want to disable that page entirely, you will need to monitor the registry, note when the wallpaoper is changed, display that message, then revert to the old wallpaper.

This article shows you how to change the wallpaper from delphi:

http://delphi.about.com/od/windowsshellapi/a/tregistry.htm

QUOTE:

uses registry;
procedure TForm1.FormCreate(Sender: TObject) ;
var
   reg:TRegistry;
begin
   reg:=TRegistry.Create;
   with reg do begin
    try
     if OpenKey('\Control Panel\desktop', False) then begin
     //change wallpaper and tile it
      reg.WriteString ('Wallpaper','c:\windows\CIRCLES.bmp') ;
      //update changes immediately
      SystemParametersInfo (SPI_SETDESKWALLPAPER,0, nil,SPIF_SENDWININICHANGE) ;
     end
    finally
      reg.Free;
    end;
   end;
end;

Simply replace 'c:\windows\CIRCLES.bmp' with the file you wish to use as wallpaper.

For help on monitoring the registry see this article:

http://delphi.about.com/od/kbwinshell/l/aa052003a.htm

The registry key you will need to monitor is: \Control Panel\desktop\Wallpaper

Hope that helps, Mark
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17028685
private
    { Private declarations }
    procedure WM_SETTINGCHANGE(var Message:TMessage); message WM_SETTINGCHANGE;

procedure TForm1.WM_SETTINGCHANGE(var Message:TMessage);
begin
  if (message.WParam = SPI_SETDESKWALLPAPER)
    or (message.Msg = SPI_SETDESKWALLPAPER)  then //wallpaper changed
end;
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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