自动调整显示器亮度(遮罩)DimMonitor

; DimMonitor.ahk
; 参考スクリプト:http://www.donationcoder.com/Software/Skrommel/index.html#DimScreen
; 単体で起動可能。#Includeする場合はAuto-Executeセクションに記述。
; 詳細は以下のページで。
; http://retla.g.hatena.ne.jp/retla/20100810/dimmonitor

#NoEnv

Dim = 0
Day = 6							; 自動調整で明るくする時間
Night = 18						; 自動調整で暗くする時間
Span = % 1000 * 60 * 60 * 2		; 手動調整後は2時間経過するまで自動調整しない
SetTimer, DimOnTop, 200			; 200msごとにアクティブウィンドウの変化を監視

;*** フィルター生成 ***
DimFilter:
	DimGui := NewGui()
	Gui, %DimGui%:+LastFound +ToolWindow -Disabled -SysMenu -Caption +E0x20 +AlwaysOnTop
	Gui, %DimGui%:Color, 000000
	Gui, %DimGui%:Show, X0 Y0 W%A_ScreenWidth% H%A_ScreenHeight%, DimMonitor
	WinGet, DimId, Id, DimMonitor ahk_class AutoHotkeyGUI
	WinSet, Transparent, % Dim * 255 / 100, ahk_id %DimId%
	If (A_ScriptName = "DimMonitor.ahk")
		Return					; 単独実行なら自動実行終了
	Else
		GoTo, DimEnd			; 組み込みならReturnしない

DimOnTop:						; 常にフィルターを最前面に配置
	IfWinNotActive, ahk_id %AWinId%
	{
		WinSet, AlwaysOnTop, On, ahk_id %DimId%
		WinGet, AWinId, Id, A
	}
	GoSub, DimTime
Return

;*** 時間帯によって明度を自動変更 ***
DimTime:
	If (A_TickCount = Night)
		Dim = 25				; 夜は明度75%
	Else
		Dim = 0
	WinSet, Transparent, % Dim * 255 / 100, ahk_id %DimId%
Return

;*** ホットキー操作 ***
#Home::							; 明度100%(不透明度0%)
	Dim = 0
	GoTo, DimHotKey
#End::							; 明度0%(不透明度100%)
	Dim = 100
	GoTo, DimHotKey
#PgDn::							; 明度を下げる(不透明度を上げる)
	Dim += 5
	If Dim > 100
		Dim = 100
	GoTo, DimHotKey
#PgUp::							; 明度を上げる(不透明度を下げる)
	Dim -= 5
	If Dim 

给TA捐赠
共{{data.count}}人
人已捐赠
其他

自动画猫

2020-3-9 5:05:44

其他

自定义Chrome的User-agent模拟其他浏览器

2020-3-9 5:07:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索