Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP]Delphi TForm1.Button1Click > set wall to desk

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
h4c0r-BG
Master Cheater
Reputation: 0

Joined: 29 Nov 2006
Posts: 449
Location: The yogurt country

PostPosted: Thu May 03, 2007 10:28 am    Post subject: [HELP]Delphi TForm1.Button1Click > set wall to desk Reply with quote

I want to make a present for my friend. Soon he`ll have a birthday and i thought I should surprise him with a program but one of the stuff i want to make in the prog. is that when he clicks a button a wallpaper (allready loaded in the program and he does not chooses it) to be set to desktop

If you can help me and tell me what components must be used or just write that simple code that i don`t know bou i would like to Embarassed

Thank you. Very Happy

_________________

Back to top
View user's profile Send private message
pyr0magex
Grandmaster Cheater Supreme
Reputation: 0

Joined: 26 Jun 2006
Posts: 1192
Location: my room

PostPosted: Thu May 03, 2007 3:49 pm    Post subject: Reply with quote

I found this code

Code:

procedure SetWallpaper(
            sWallpaperBMPPath : String;
            bTile : boolean );
var
  reg : TRegIniFile;
begin
  //
  // change registry
  //
  // HKEY_CURRENT_USER
  //   Control Panel\Desktop
  //     TileWallpaper (REG_SZ)
  //     Wallpaper (REG_SZ)
  //
  reg := TRegIniFile.Create(
           'Control Panel\Desktop' );
  with reg do
  begin
    WriteString( '', 'Wallpaper',
      sWallpaperBMPPath );
    if( bTile )then
    begin
      WriteString(
        '', 'TileWallpaper', '1' );
    end else
    begin
      WriteString(
        '', 'TileWallpaper', '0' );
    end;
  end;
  reg.Free;

  //
  // let everyone know that we changed
  // a system parameter
  //
  SystemParametersInfo(
    SPI_SETDESKWALLPAPER,
    0,
    Nil,
    SPIF_SENDWININICHANGE );
end;


1. I don't know if it works.
2. it only works for .bmp's
3. you would have to save the image to some temporary place first and insert that as the path string

good luck

_________________
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Thu May 03, 2007 6:49 pm    Post subject: Reply with quote

You could also pack the resources into the EXE.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites