Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

HOW TO KNOW WHEN THE USER CHANGE THE WALLPAPER

Posted on 2006-07-02
2
Medium Priority
?
242 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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