找回密码
 加入
搜索
查看: 3194|回复: 7

[AU3基础] 谁把这个AHK的代码用au3重写一下

  [复制链接]
发表于 2010-12-19 01:12:15 | 显示全部楼层 |阅读模式
刚学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
发表于 2010-12-19 09:59:57 | 显示全部楼层
对AHK不懂,飘过,等达人解决
发表于 2010-12-19 19:29:54 | 显示全部楼层
AHk我只是用来进行快捷键的设置,其它方面没有涉及,我怕我脑子被搅昏了在AU3界和AHK界都一事无成。
发表于 2010-12-19 19:54:42 | 显示全部楼层
我最开始接触的也是AHK  虽然强大 好多高手发有示例 但是关注的人太少了  对初学者来说是个大问题 有什么不懂的 提个问题可能要等几天 AU3就不一样  热心的会员和版主太多了   不懂的提问要不了多久就可以和答案  很快就可以进入下一个阶段
 楼主| 发表于 2010-12-19 20:21:32 | 显示全部楼层
其实就个改变屏幕颜色和透明度的一段ahk代码。
发表于 2010-12-19 21:20:35 | 显示全部楼层
ahk的东东也需要借鉴哦。有些都是现成的,拿过来改改就成
 楼主| 发表于 2010-12-30 06:00:32 | 显示全部楼层
那个大侠帮改写一下嘛
比如这句:Gui, +AlwaysOnTop +ToolWindow +E0x00000020
在au3里怎么写呀
发表于 2010-12-31 12:15:00 | 显示全部楼层
$Form1 = GUICreate("Form1", 615, 438, 192, 124, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE))


+AlwaysOnTop +ToolWindow +E0x00000020
$WS_EX_TOPMOST $WS_EX_TOOLWINDOW $WS_EX_TRANSPARENT
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-27 18:27 , Processed in 0.082406 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表