找回密码
 加入
搜索
查看: 2928|回复: 3

[图形处理] 【已解决】怎么用Autoit 全屏显示某种颜色,敲任意键后换一种颜色

[复制链接]
发表于 2012-6-25 21:56:21 | 显示全部楼层 |阅读模式
本帖最后由 jwwlchen 于 2012-6-26 07:13 编辑

怎么用Autoit 全屏显示某种颜色,敲任意键后换一种颜色

请不吝赐教,谢谢大家了
发表于 2012-6-25 22:06:54 | 显示全部楼层
本帖最后由 xms77 于 2012-6-25 22:49 编辑

创建一个全屏的无边框的form,背景设置你想要的颜色就行了,下面的列子是只能敲击空格键来切换颜色,按ESC键退出。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

Local $dll = DllOpen("user32.dll")
HotKeySet("{ESC}", "_Exit")
Local $arrayColor[4] = ["0x000000","0x0000ff","0x00ff00","0xff0000"]
$form = GUICreate("", @DesktopWidth,@DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))


GUISetState(@SW_SHOW)
$i = 0
While 1
        If _IsPressed("20",$dll) Then   ;检测是否按了空格键?
                GUISetBkColor($arrayColor[$i],$form)
                $i += 1
                If $i = 4 Then $i = 0
        EndIf
        Sleep(100)
WEnd
Func _Exit()
                DllClose($dll)
        Exit
EndFunc

评分

参与人数 2金钱 +40 收起 理由
user3000 + 10
魔导 + 30 好方法,谢分享

查看全部评分

 楼主| 发表于 2012-6-26 07:13:03 | 显示全部楼层
非常感谢您的帮助
发表于 2012-8-7 20:48:17 | 显示全部楼层
判断任意键按下该如何做呢?
一定要用_IsPressed循环判断?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-28 04:07 , Processed in 0.080992 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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