forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Temporarily disable Screen saver
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Aug 13, 2003 10:23 pm    Post subject: Reply with quote

Thnx. I'll have a look..

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Aug 14, 2003 3:31 am    Post subject: Reply with quote

Dr. Dread wrote:
BTW, while you were doing this, did you come across another API function that could turn off
screen power?
Hey thought about another one also: what about one that would activate the screen saver right away?
Dread

Yes all these are possible under SystemParametersInfoA API i think, and some of them using @sendmessage also as Tommy said.
Dr. Dread - Also note that there are *lot* many more interesting things you can do with this API - it has one of the largest number of options in it's parameters Very Happy
Unfortunately it didn't come to my attention earlier Sad .
Thanks for the typo info - Iwill correct that.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Aug 14, 2003 8:02 am    Post subject: Reply with quote

You're right CodeScript - that's an extensive API. Couldn't find anything about making screen
blackout or power off Crying or Very sad . Grabbed a few others though. If anyone can use it, then here's code for 3
more buttons for CodeScript's little Screensaver util. Make the buttons yourself Wink

Code:
:BUTTON4BUTTON
REM Set the screen saver's timeout to %X secs
%X = 1800
LOADLIB USER32
%U = @LIB(USER32,SystemParametersInfoA,INT:,15,%X,0,0)
FREELIB USER32
GOTO EVLOOP

:BUTTON5BUTTON
REM Obtain the current screensaver timeout
LOADLIB USER32
%I = @BINARY(DWORD,0)
%U = @LIB(USER32, SystemParametersInfoA,INT:,14,0,@ADDR("%I"),0)
%I = @VAL(%I)
IF @ZERO(%I)
 INFO No info obtained
ELSE
 INFO ScreenSaver timeout is %I secs. (@div(%I,60) mins.)
END
FREELIB USER32
GOTO EVLOOP

:BUTTON6BUTTON
REM Check whether a screensaver is currently running
LOADLIB USER32
%I = @BINARY(DWORD,0)
%U = @LIB(USER32, SystemParametersInfoA,INT:,114,0,@ADDR("%I"),0)
%I = @VAL(%I)
IF @ZERO(%I)
 INFO No Screensaver is running
ELSE
 INFO ScreenSaver is running
END
FREELIB USER32
GOTO EVLOOP


Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Oct 14, 2003 3:09 am    Post subject: Reply with quote

The code has been completely updated to make it more robust and have more options.
http://forum.vdsworld.com/viewtopic.php?p=15358#15358

Enjoy

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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 can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group