?
Solved

HOW TO KNOW WHEN THE USER CHANGE THE WALLPAPER

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

Technology Partners: 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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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