Turning screen saver off in Delphi 1

How do you turn the screen saver off in Delphi 1 (for Windows 3.1 programming)? I want to turn it off when it is running. I've tried the WIN3.1 API SendMessage function, but I may be sending the wrong parameters. (Please test anything before you post it.) I have used the API function SystemParametersInfo to make sure a screensaver is available, and then the PostMessage (GetDeskTopWindow, WM_SYSCOMMAND, SC_SCREENSAVE, 0) to start the screensaver, but I can't get the screensaver to stop running.
elmaraisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EpsylonCommented:
Use   SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, nil, 0);

0
elmaraisAuthor Commented:
Edited text of question.
0
MadshiCommented:
Well, I don't have D1 installed, so I can't test it. But this should work:

  PostMessage(FindWindow('WindowsScreenSaverClass',nil),WM_CLOSE,0,0);

Regards, Madshi.
0
elmaraisAuthor Commented:
Well, Madshi - it works! ! ! !

You saved me a l-o-t of time, thanks!

Now how do I get the 100 points back? :-)
0
MadshiCommented:
Well, that's great that it works. I only hoped that these APIs were available in 16bit Windows, too...   :-)

How you get your points back?    :-)
Either wait 20 days (you get 5 points each day) or buy 100 points...    :-)

Regards, Madshi.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.