Solved

HOW TO KNOW WHEN THE USER CHANGE THE WALLPAPER

Posted on 2006-07-02
2
236 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

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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