DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: countdown screensaver manager  (Read 8,005 times)

openbsd6

  • Participant
  • Joined in 2006
  • *
  • Posts: 4
IDEA: countdown screensaver manager
« on: May 07, 2008, 03:43 PM »
there're a lot of 'countdown\ screensavers out there..but i had this idea, all those countdown screensavers run against a black(or colour-configurable) background..quite boring..how about a screensaver that launches other savers whilst displaying the countdown on top ofn that screensaver..it could be an images slideshow or video or anything screensaver, the countdown screensaver will simply run it and display the countdown ontop of it in a configurable corner of the screen..much better than a blank background..

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: countdown screensaver manager
« Reply #1 on: June 14, 2008, 10:47 PM »
:) Here's CountdownSaver to get you started!

Displays a countdown on top of the active screensaver.

Skrommel


Code
;CountdownSaver.ahk
; Displays a countdown on top of the active screensaver
;Skrommel @ 2008 

#NoEnv
#SingleInstance,Force
SetWorkingDir,%A_ScriptDir%
SetWinDelay,0

date=20081224000000  ;YYMMDDHHMMSS
font=Verdena
color=ffffff
size=20
weight=700
x=0
y=0

Gui,-Caption +ToolWindow
Gui,Margin,0,0
Gui,Font,S%size% W%weight% C%color%,%font%
time:=date
EnvSub,time,%A_Now%,Days
FormatTime,formatdate,%date%,dddd dd. MMMM yyyy
Gui,Add,Text,Center Vtext,%time% days left until`n%formatdate%
Gui,Color,123456
Gui,+LastFound
guiid:=WinExist()
WinSet,TransColor,123456 150
SetTimer,CHECKSCREENSAVER,1000
Return


CHECKSCREENSAVER:
  oldactive:=active
  VarSetCapacity(active,4,0) 
  DllCall("user32.dll\SystemParametersInfo","uint",0x0072,"uint",0,"uint*",active,"uint",0) ; SPI_GETSCREENSAVERRUNNING = 0x0072  
  If active>0
  {
    time:=date
    EnvSub,time,%A_Now%,Days
    FormatTime,formatdate,%date%,dddd dd. MMMM yyyy
    GuiControl,,text,%time% days left until`n%formatdate%
    Gui,Show,X%x% Y%y% NoActivate
    WinSet,Topmost,,ahk_id %guiid%
  }
  Else
  If oldactive=1
    Gui,Hide
Return

Original address: https://www.donationcoder.com/forum/index.php?topic=13276.0