View previous topic :: View next topic |
Author |
Message |
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 13, 2003 10:23 pm Post subject: |
|
|
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 |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Aug 14, 2003 3:31 am Post subject: |
|
|
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
Unfortunately it didn't come to my attention earlier .
Thanks for the typo info - Iwill correct that. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Aug 14, 2003 8:02 am Post subject: |
|
|
You're right CodeScript - that's an extensive API. Couldn't find anything about making screen
blackout or power off . 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
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 |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
|
Back to top |
|
|
|
|
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
|
|