|
刚学au3,对GUI的东西不熟悉,主要想学习一下au3.
--------------------------------ahk 代码--------------------------------
Hotkey = F9 ; toggles Invert screen colors
RepaintPeriod = 300 ; repaint screen period (don't set it too low! --> heavy CPU load)
;===Auto-execute continuation===========================================================
#SingleInstance ignore
OnExit ExitSub
Gui, +AlwaysOnTop +ToolWindow +E0x00000020
Gui, color, black
Gui, Show, na X0 Y0 W%A_ScreenWidth% H%A_ScreenHeight%, InvertScreenColors
WinSet, Transparent, 255, InvertScreenColors
Gui, -Caption
WinGet, PrintSourceID, id
hdd_frame := DllCall("GetDC", UInt, PrintSourceID)
WinGet, PrintScreenID, id, InvertScreenColors
hdc_frame := DllCall("GetDC", UInt, PrintScreenID)
DllCall("gdi32.dll\SetStretchBltMode", "uint", hdc_frame, "int", 4)
SetTimer, Repaint, %RepaintPeriod%
Hotkey, %Hotkey%, ISC
Return ;===Auto-execute ends here===
;===Subroutines=========================================================================
Repaint:
DllCall("gdi32.dll\StretchBlt", UInt, hdc_frame, Int, 0, Int, 0, Int, A_ScreenWidth, Int, A_ScreenHeight, UInt, hdd_frame, Int, 0, Int, 0, Int, A_ScreenWidth, Int, A_ScreenHeight, UInt, 0x330008)
Return
ISC:
ISC ++
if ISC = 1
{
SetTimer, Repaint, off
Gui, hide
}
Else
{
SetTimer, Repaint, %RepaintPeriod%
Gui, show, na
ISC = 0
}
Return
ExitSub:
DllCall("gdi32.dll\DeleteDC", UInt, hdc_frame)
DllCall("gdi32.dll\DeleteDC", UInt, hdd_frame)
ExitApp
;===Exit Hotkey=====================================================Escape::ExitApp |
|