Solved

Making My App Active to disable screen-saver

Posted on 2001-06-05
5
593 Views
Last Modified: 2007-11-27
I disable screen saver with catching the win message, but this only works if my App is active. How to make it always active or just when I need to disable scr-saver to show program to the user. All must be in program without user intercede.
0
Comment
Question by:TomazB
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6156309
procedure TForm1.Scr_Disable;
begin
  SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,0,nil,0);
end;

procedure TForm1.Scr_Enable;
begin
  SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,1,nil,0);
end;
0
 
LVL 3

Expert Comment

by:ckaneta
ID: 6156341
Another option....

  reg := TRegistry.Create;    reg.RootKey := HKEY_CURRENT_USER;
  reg.OpenKey('\Control Panel\Desktop\',FALSE);
// enable screen saver
   reg.WriteString('ScreenSaveActive','1');
// disble screen saver
   reg.WriteString('ScreenSaveActive','0');
  end;
  reg.CloseKey;               reg.Free;
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 100 total points
ID: 6156413
If you want to make it really permanent (after reboot) use this:

procedure TForm1.Scr_Disable;
begin
 SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,0,nil,SPIF_UPDATEINIFILE);
end;

procedure TForm1.Scr_Enable;
begin
 SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,1,nil,SPIF_UPDATEINIFILE);
end;  


Maybe this Goooooogle thread is also interesting:

http://groups.google.com/groups?hl=nl&lr=&safe=off&ic=1&th=3149612aa38fffb6,11&seekm=3a59c0db.1200556%40news.tel.hr#p
0
 

Author Comment

by:TomazB
ID: 6157283
Epsylon thanks!

It's just what I needed and it's much more simple than my try!
0
 

Author Comment

by:TomazB
ID: 6183347
HEY!!! But this doesn't stop already started screen saver!
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

Title # Comments Views Activity
Intraweb download file link ? 1 153
Making delphi communicate with a c# service 16 111
TEMBEDDEDWB how can i change its user agent ? 8 69
Base1 Encode/Decode 3 81
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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