?
Solved

Screen Saver on a form !!!!!

Posted on 1999-07-29
4
Medium Priority
?
163 Views
Last Modified: 2010-04-04
I have a screen saver ie MyScreenSaver.Scr. I also have a form in my application ie MyAppForm, on this form I have a large panel, and in this large panel I want to show the above screensaver, ..

Can this be done and if so, how do I do it ????

Thanx in advance

Stu
0
Comment
Question by:StuartB_99
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 1391792
Hi Stu

procedure TForm1.Button1Click(Sender: TObject);
var
  screensaver : string ;
begin
  screensaver := 'c:\windows\system\starflight.scr /P' + InttoStr( Panel1.Handle );
  WinExec(pchar(screensaver), SW_SHOWNormal);

end;

note when your finished you must free the panel to free the screensaver form mempry else you most likely get errors.
either panel1.Perform(CM_RECREATEWND, 0, 0); or
panel1.free; will do it.
Regards Barry
0
 

Expert Comment

by:PROGRAMMING030999
ID: 1391793
Hi Stu,
If your Screensaver supports the Preview, you could use
something like:

procedure TForm1.Button1Click(Sender: TObject);
begin

screensaver := 'c:\win95\system\Flying Windows.scr /P' + InttoStr(Panel1.Handle );

WinExec(pchar(screensaver), SW_SHOWNormal);
end;

Michael

0
 

Author Comment

by:StuartB_99
ID: 1391794
Thanx very much,...

Stuart
0
 

Author Comment

by:StuartB_99
ID: 1391795
Cheers Michael, but Barry just pipped you to the post, but a huge thankyou to you both..

Stuart

SBond@Costcutter.Com
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

599 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