找回密码
 加入
搜索
查看: 20849|回复: 46

[原创] 源码+死循环停止按钮+皮肤使用方法

 火... [复制链接]
发表于 2009-7-17 12:46:19 | 显示全部楼层 |阅读模式
$Button1 = GUICtrlCreateButton("开始", 50, 184, 97, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("停止", 180, 184, 97, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Quit()
                        Exit
                       
Case $Button1  ;按下“开始”死循环开始
                       
        While 1       

        $x1=Execute(GUICtrlRead($Checkbox1))
        $x2=Execute(GUICtrlRead($Checkbox2))
        $s1=Execute(GUICtrlRead($Input1))
        $s2=Execute(GUICtrlRead($Input2))
        $s3=Execute(GUICtrlRead($Input3))
        $s4=Execute(GUICtrlRead($Input4))
        $s5=Execute(GUICtrlRead($Input5))
        $a=Random(0,9,1)
        $b=Random(0,9,1)
        $c=Random(0,9,1)
       
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $Button2 ;按下“停止”按钮死循环停止
                ExitLoop
                EndSwitch

   If         $x1=1 and $x2<>1 then ;只选择“排除的数”执行下面的循环       
                         
                While $a=$s1 or $a=$s2 or $a=$s3 or $a=$s4 or $a=$s5 or $b=$s1 or $b=$s2 or $b=$s3 or $b=$s4 or $b=$s5 or $c=$s1 or $c=$s2 or $c=$s3 or $c=$s4 or $c=$s5
                        $a=Random(0,9,1)
                        $b=Random(0,9,1)
                        $c=Random(0,9,1)
                Wend
                EndIF
               
        If $x2=1 and $x1<>1 then;只选择“号不重复”执行下面的循环
               
                While $a=$b or $a=$c or $b=$c
                        $a=Random(0,9,1)
                        $b=Random(0,9,1)
                        $c=Random(0,9,1)
                        Wend
                EndIf
               
        If         $x1=1 and $x2=1 then ;“号不重复”、“排除的数”都选择执行下面的循环       
                         
                While $a=$s1 or $a=$s2 or $a=$s3 or $a=$s4 or $a=$s5 or $b=$s1 or $b=$s2 or $b=$s3 or $b=$s4 or $b=$s5 or $c=$s1 or $c=$s2 or $c=$s3 or $c=$s4 or $c=$s5 or $a=$b or $a=$c or $b=$c
                        $a=Random(0,9,1)
                        $b=Random(0,9,1)
                        $c=Random(0,9,1)
                Wend
                EndIF
               
      GUICtrlSetData($Input6,$a)
      GUICtrlSetData($Input7,$b)
      GUICtrlSetData($Input8,$c)
WEnd
        EndSwitch
WEnd

;定义退出函数
Func Quit()
    GUISetState(@SW_HIDE)
    DllCall($dll, "int:cdecl", "DeInitDecoration")
    DllCall($dll, "int:cdecl", "RemoveSkin")
    DllClose($dll)
        FileDelete(@TempDir & "\SkinCrafterDll.dll");退出后删除
        FileDelete(@TempDir & "\Zondar.skf")
    Exit
EndFunc
;定义皮肤函数
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
   $Dll = DllOpen($SkincrafterDll)
   DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
   DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
   DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
   DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
   DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc      ;==

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2009-7-17 12:48:25 | 显示全部楼层
源码少了一些看下面
 楼主| 发表于 2009-7-17 12:50:10 | 显示全部楼层
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=TB.ico
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;======================要写入的文件============================================
FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
   FileInstall("Zondar.skf", @TempDir & "\Zondar.skf", 1)
;==========================================================================
$Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
Global $Dll
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("3D选号器", 321, 261, 261, 161)
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\Zondar.skf", $Form1);_SkinGUI("SkinCrafterDll.dll","皮肤","窗口")
$Label1 = GUICtrlCreateLabel("排除的数", 25, 20, 52, 17)
$Label2 = GUICtrlCreateLabel("号不重复", 25, 40, 52, 17)
$Input1 = GUICtrlCreateInput("", 86, 16, 25, 21)
$Input2 = GUICtrlCreateInput("", 126, 16, 25, 21)
$Input3 = GUICtrlCreateInput("", 166, 16, 25, 21)
$Input4 = GUICtrlCreateInput("", 206, 16, 25, 21)
$Input5 = GUICtrlCreateInput("", 246, 16, 25, 21)
$Checkbox1 = GUICtrlCreateCheckbox("", 5, 20, 17, 14)
$Checkbox2 = GUICtrlCreateCheckbox("", 5, 40, 17, 14)
$Input6 = GUICtrlCreateInput("", 86, 127, 25, 21)
$Input7 = GUICtrlCreateInput("", 146, 127, 25, 21)
$Input8 = GUICtrlCreateInput("", 206, 127, 25, 21)
$Label3 = GUICtrlCreateLabel("选号结果:", 80, 96, 64, 17)
$Button1 = GUICtrlCreateButton("开始", 50, 184, 97, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("停止", 180, 184, 97, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Quit()
                        Exit
                       
Case $Button1  ;按下“开始”死循环开始
                       
        While 1       

        $x1=Execute(GUICtrlRead($Checkbox1))
        $x2=Execute(GUICtrlRead($Checkbox2))
        $s1=Execute(GUICtrlRead($Input1))
        $s2=Execute(GUICtrlRead($Input2))
        $s3=Execute(GUICtrlRead($Input3))
        $s4=Execute(GUICtrlRead($Input4))
        $s5=Execute(GUICtrlRead($Input5))
        $a=Random(0,9,1)
        $b=Random(0,9,1)
        $c=Random(0,9,1)
       
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $Button2 ;按下“停止”按钮死循环停止
                ExitLoop
                EndSwitch

   If         $x1=1 and $x2<>1 then ;只选择“排除的数”执行下面的循环       
                         
                While $a=$s1 or $a=$s2 or $a=$s3 or $a=$s4 or $a=$s5 or $b=$s1 or $b=$s2 or $b=$s3 or $b=$s4 or $b=$s5 or $c=$s1 or $c=$s2 or $c=$s3 or $c=$s4 or $c=$s5
                        $a=Random(0,9,1)
                        $b=Random(0,9,1)
                        $c=Random(0,9,1)
                Wend
                EndIF
               
        If $x2=1 and $x1<>1 then;只选择“号不重复”执行下面的循环
               
                While $a=$b or $a=$c or $b=$c
                        $a=Random(0,9,1)
                        $b=Random(0,9,1)
                        $c=Random(0,9,1)
                        Wend
                EndIf
               
        If         $x1=1 and $x2=1 then ;“号不重复”、“排除的数”都选择执行下面的循环       
                         
                While $a=$s1 or $a=$s2 or $a=$s3 or $a=$s4 or $a=$s5 or $b=$s1 or $b=$s2 or $b=$s3 or $b=$s4 or $b=$s5 or $c=$s1 or $c=$s2 or $c=$s3 or $c=$s4 or $c=$s5 or $a=$b or $a=$c or $b=$c
                        $a=Random(0,9,1)
                        $b=Random(0,9,1)
                        $c=Random(0,9,1)
                Wend
                EndIF
               
      GUICtrlSetData($Input6,$a)
      GUICtrlSetData($Input7,$b)
      GUICtrlSetData($Input8,$c)
WEnd
        EndSwitch
WEnd

;定义退出函数
Func Quit()
    GUISetState(@SW_HIDE)
    DllCall($dll, "int:cdecl", "DeInitDecoration")
    DllCall($dll, "int:cdecl", "RemoveSkin")
    DllClose($dll)
        FileDelete(@TempDir & "\SkinCrafterDll.dll");退出后删除
        FileDelete(@TempDir & "\Zondar.skf")
    Exit
EndFunc
;定义皮肤函数
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
   $Dll = DllOpen($SkincrafterDll)
   DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
   DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
   DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
   DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
   DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc      ;==

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-7-17 17:58:00 | 显示全部楼层
这个皮肤很不错,下来看看!
发表于 2009-7-25 11:16:15 | 显示全部楼层
又要三块钱啊。。
发表于 2009-7-25 11:16:15 | 显示全部楼层
又要三块钱啊。。
发表于 2009-7-25 11:16:20 | 显示全部楼层
快没钱了。。
发表于 2009-7-25 11:16:21 | 显示全部楼层
快没钱了。。
发表于 2009-7-25 11:16:46 | 显示全部楼层
给钱了也下载不了。。
发表于 2009-7-25 11:16:53 | 显示全部楼层
怎么回事啊。
发表于 2009-7-25 11:17:06 | 显示全部楼层
不知道啊大工业
发表于 2009-7-25 14:30:22 | 显示全部楼层
好东西要看看!!!!!
 楼主| 发表于 2009-8-15 16:42:07 | 显示全部楼层
现在能下吗?不能的话我在发一次。
发表于 2009-9-15 14:14:31 | 显示全部楼层
wo de $$
发表于 2009-9-19 17:11:34 | 显示全部楼层
下来看看  顺便顶一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-20 22:00 , Processed in 0.081623 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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