Website Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 31, 2015, 01:49:05 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: A couple small modifications to TrayScreenSaver  (Read 2201 times)

VodkaL

  • Participant
  • Joined in 2010
  • *
  • gravatar avatar
  • Posts: 1
    • View Profile
    • Donate to Member
A couple small modifications to TrayScreenSaver
« on: February 07, 2010, 12:47:43 AM »
Tell me what you think, and feel free to use it.

Code: AutoIt
  1.  
  2. ;TrayScreenSaver.ahk
  3. ; Control the screensaver from the tray
  4. ;Skrommel @ 2006
  5.  
  6. #SingleInstance,Force
  7. #Persistent
  8.  
  9. applicationname=TrayScreenSaver
  10.  
  11. Gosub,TRAYMENU
  12. Gosub,ACTIVE
  13.  
  14.  
  15. TRAYMENU:
  16. savers=
  17. Loop,%A_WinDir%\*.scr
  18.   savers=%savers%%A_LoopFileName%`n
  19. Loop,%A_WinDir%\System32\*.scr
  20.   savers=%savers%%A_LoopFileName%`n
  21. StringSplit,savers_,savers,`n
  22. savers_0-=1
  23.  
  24. Menu,Tray,Click,1
  25. Menu,Tray,NoStandard
  26. Menu,Tray,DeleteAll
  27. Menu,Tray,Add,%applicationname%,DOUBLECLICK
  28. Menu,Tray,Add,
  29.  
  30. Menu,savermenu,add,
  31. Menu,tray,add,Saver Menu, :savermenu
  32.  
  33. Loop,%savers_0%
  34. {
  35.   screensaver:=savers_%A_Index%
  36.   Menu,savermenu,Add,%screensaver%,SELECT
  37. }
  38.  
  39. Menu,Tray,Add,
  40. Menu,Tray,Add,Power &Off Monitor,Off
  41. Menu,Tray,Add,&Run,RUN
  42. Menu,Tray,Add,&Enabled,TOGGLE
  43. Menu,Tray,Add,&Settings...,SETTINGS
  44. Menu,Tray,Add,
  45. Menu,Tray,Add,&About...,ABOUT
  46. Menu,Tray,Add,E&xit,EXIT
  47.  
  48. Menu,Tray,Default,%applicationname%
  49. Menu,Tray,Check,&Enabled
  50. Menu,Tray,Tip,%applicationname%
  51.  
  52.  
  53.  
  54. Run,%A_ThisMenuItem% /s
  55.  
  56.  
  57. SINGLECLICK:
  58. SetTimer,SINGLECLICK,Off
  59. clicks=
  60. Gosub,TOGGLE
  61.  
  62.  
  63. DOUBLECLICK:
  64. If clicks=
  65. {
  66.   SetTimer,SINGLECLICK,500
  67.   clicks=1
  68.   Return
  69. }
  70. SetTimer,SINGLECLICK,Off
  71. clicks=
  72. Gosub,RUN
  73.  
  74.  
  75. TOGGLE:
  76. RegRead,active,HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaveActive
  77. If active=1
  78.   active=0
  79.   active=1
  80. RegWrite,Reg_SZ,HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaveActive,%active%
  81. Gosub,ACTIVE
  82.  
  83.  
  84. ACTIVE:
  85. RegRead,active,HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaveActive
  86. If active=1
  87. {
  88.   Menu,Tray,Icon,%applicationname%.exe,1,1
  89.   Menu,Tray,Check,&Enabled
  90. }
  91. {
  92.   Menu,Tray,Icon,%applicationname%.exe,4,4
  93.   Menu,Tray,UnCheck,&Enabled
  94. }
  95.  
  96.  
  97. RegRead,screensaver,HKEY_CURRENT_USER,Control Panel\Desktop,ScrnSave.Exe
  98. IfInString,screensaver,.scr
  99.   Run,%screensaver% /s
  100.   Gosub,SETTINGS
  101.  
  102. Off:
  103. Sleep 1000
  104. SendMessage, 0x112, 0xF170, 2,, Program Manager
  105.  
  106. SETTINGS:
  107. RegRead,screensaver,HKEY_CURRENT_USER,Control Panel\Desktop,ScrnSave.Exe
  108. Run,rundll32.exe desk.cpl`,InstallScreenSaver %screensaver%
  109.  
  110.  
  111. ABOUT:
  112. Gui,99:Destroy
  113. Gui,99:Margin,20,20
  114. Gui,99:Add,Picture,xm Icon1,%applicationname%.exe
  115. Gui,99:Font,Bold
  116. Gui,99:Add,Text,x+10 yp+10,%applicationname% v1.0
  117. Gui,99:Font
  118. Gui,99:Add,Text,y+10,Control the screensaver from the tray
  119. Gui,99:Add,Text,y+5,- Singleclick to enable or disable the screensaver
  120. Gui,99:Add,Text,y+5,- Doubleclick the tray icon to run the default screensaver
  121. Gui,99:Add,Text,y+5,- Run any screensaver from the tray menu
  122. Gui,99:Add,Text,y+5,- Change settings using Settings in the tray menu
  123.  
  124. Gui,99:Add,Picture,xm y+20 Icon5,%applicationname%.exe
  125. Gui,99:Font,Bold
  126. Gui,99:Add,Text,x+10 yp+10,1 Hour Software by Skrommel
  127. Gui,99:Font
  128. Gui,99:Add,Text,y+10,For more tools, information and donations, please visit
  129. Gui,99:Font,CBlue Underline
  130. Gui,99:Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com
  131. Gui,99:Font
  132.  
  133. Gui,99:Add,Picture,xm y+20 Icon7,%applicationname%.exe
  134. Gui,99:Font,Bold
  135. Gui,99:Add,Text,x+10 yp+10,DonationCoder
  136. Gui,99:Font
  137. Gui,99:Add,Text,y+10,Please support the contributors at
  138. Gui,99:Font,CBlue Underline
  139. Gui,99:Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com
  140. Gui,99:Font
  141.  
  142. Gui,99:Add,Picture,xm y+20 Icon6,%applicationname%.exe
  143. Gui,99:Font,Bold
  144. Gui,99:Add,Text,x+10 yp+10,AutoHotkey
  145. Gui,99:Font
  146. Gui,99:Add,Text,y+10,This tool was made using the powerful
  147. Gui,99:Font,CBlue Underline
  148. Gui,99:Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com
  149. Gui,99:Font
  150.  
  151. Gui,99:Show,,%applicationname% About
  152. hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
  153. OnMessage(0x200,"WM_MOUSEMOVE")
  154.  
  155. 1HOURSOFTWARE:
  156.   Run,http://www.1hoursoftware.com,,UseErrorLevel
  157.  
  158. DONATIONCODER:
  159.   Run,http://www.donationcoder.com,,UseErrorLevel
  160.  
  161. AUTOHOTKEY:
  162.   Run,http://www.autohotkey.com,,UseErrorLevel
  163.  
  164. 99GuiClose:
  165.   Gui,99:Destroy
  166.   OnMessage(0x200,"")
  167.   DllCall("DestroyCursor","Uint",hCur)
  168.  
  169. WM_MOUSEMOVE(wParam,lParam)
  170. {
  171.   Global hCurs
  172.   MouseGetPos,,,,ctrl
  173.   If ctrl in Static10,Static14,Static18
  174.     DllCall("SetCursor","UInt",hCurs)
  175. }
  176.  
  177.  
  178. ExitApp
  179.  
  180.  

If you dont have his icons and compile the script, you can just put the script in the same folder as his exe and run the script
VodkaL
« Last Edit: February 07, 2010, 01:02:34 AM by VodkaL »