找回密码
 加入
搜索
查看: 1252|回复: 5

请教双窗口关闭的问题!

  [复制链接]
发表于 2010-1-24 04:58:48 | 显示全部楼层 |阅读模式
本帖最后由 woeiwoei 于 2010-1-24 12:57 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
Dim $Dll
FileInstall("SkinCrafterDll.dll",@WindowsDir & "\temp","1")
FileInstall("vista.skf",@WindowsDir & "\temp","1")
$Form1 = GUICreate("系统自主维护 By·MjM", 244, 144, 373, 157)
_SkinGUI(@WindowsDir & "\temp\SkinCrafterDll.dll" ,@WindowsDir & "\temp\vista.skf", $Form1)
$xthf = GUICtrlCreateButton("系统恢复", 8, 16, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$qdaz = GUICtrlCreateButton("驱动安装", 88, 16, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$fbl = GUICtrlCreateButton("分辨率", 168, 16, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$gip = GUICtrlCreateButton("更改IP", 8, 64, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$xtyh = GUICtrlCreateButton("系统优化", 88, 64, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$xgj = GUICtrlCreateButton("小工具", 168, 64, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$help = GUICtrlCreateButton("帮助", 16, 112, 49, 17, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$lxw = GUICtrlCreateButton("联系我", 96, 111, 49, 17, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$exit = GUICtrlCreateButton("退出", 176, 112, 49, 17, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
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 

Func Quit()
    GUISetState(@SW_HIDE)
    DllCall($dll, "int:cdecl", "DeInitDecoration")
    DllCall($dll, "int:cdecl", "RemoveSkin")
    DllClose($dll)
        FileDelete(@WindowsDir & "\temp\SkinCrafterDll.dll")
        FileDelete(@WindowsDir & "\temp\vista.skf")
    Exit
EndFunc

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $xthf
                        BOOT() ;恢复系统
                Case $qdaz
                        DRV() ;安装驱动
                Case $fbl
                        RESO() ;设置分辨率
                Case $gip
                        SETIP() ;设置IP
                Case $xtyh
                        OPIT() ;系统垃圾清理和一些优化
                Case $xgj
                        Tool() ;一些系统工具
                Case $help
                        HELP() ;本程序的说明
                Case $lxw
                        Contact() ;与我联系
                Case $exit
                        Exit
        EndSwitch
WEnd

Func BOOT()
        $a = MsgBox(0, "提示", " 确定 后请您选择您的备份文件,如没备份请先备份!")
If $a Then
Run("E:\Tools\Ghost\boot.exe", "", @SW_HIDE)
Exit
EndIf
EndFunc   ;==>BOOT

Func DRV()
        Run("E:\TOOLS\SkyD9.9es\DrvS3.exe")
EndFunc   ;==>DRV

Func RESO()
        Run("E:\Tools\分辨率\分辨率.exe")
EndFunc   ;==>RESO

Func SETIP()
        Run("E:\Tools\ip\MacToIp1.0.exe")
EndFunc   ;==>SETIP        
        
Func OPIT()
        Run("E:\Tools\系统优化\mstool.exe")
EndFunc   ;==>RESO

Func Tool()
        ShellExecute("E:\Tools\小工具")
EndFunc


Func HELP()
        $form1_2= GUICreate("程序说明", 300, 200, 352, 200)
        $Label1 = GUICtrlCreateLabel("" & @CRLF & "                      说 明" & @CRLF & "" & @CRLF & "" & @CRLF & "1、恢复系统前请您先备份!" & @CRLF & "" & @CRLF & "2、驱动用的是自由天空9.9ES的驱动包." & @CRLF & ""  & @CRLF & "3、设置IP根据需要请修改E:\Tools\IP下的 "& @CRLF &"   Mac2Ip.ini文件,请勿修改文件名!" & @CRLF & "" & @CRLF & "4、这是本人第一个小程序,如有意见请联系我!" & @CRLF & "   我的MAIL:an_8437@163.com QQ:570264002", 0, 0, 400, 300)
        GUISetState(@SW_SHOW)
EndFunc   ;==>HELP

Func Contact()
        MsgBox(0,"您好","作者MAIL:an_8437@163.com,QQ:570264002"& @CRLF & "欢迎您的意见和建议!")
        Run(@ProgramFilesDir&"\Outlook Express\msimn.exe")
EndFunc
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                 FileDelete(@WindowsDir & "\temp\SkinCrafterDll.dll")
             FileDelete(@WindowsDir & "\temp\vista.skf")
                        Exit

        EndSwitch
WEnd
运行程序后 点 帮助 出来一个 GUI 但是 点帮助 右上角的 关闭时,程序也会关闭。。
高手帮帮忙呀···我只想看完 帮助后 关闭 帮助的那个窗口 不想关闭程序呀!

评分

参与人数 1金钱 +10 收起 理由
pusofalse + 10 感谢主动修改帖子分类为[已解决]。

查看全部评分

发表于 2010-1-24 07:36:18 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
Dim $Dll
FileInstall("SkinCrafterDll.dll",@WindowsDir & "\temp","1")
FileInstall("vista.skf",@WindowsDir & "\temp","1")

$Form1 = GUICreate("系统自主维护 By·MjM", 244, 144, 373, 157)
_SkinGUI(@WindowsDir & "\temp\SkinCrafterDll.dll" ,@WindowsDir & "\temp\vista.skf", $Form1)
$xthf = GUICtrlCreateButton("系统恢复", 8, 16, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$qdaz = GUICtrlCreateButton("驱动安装", 88, 16, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$fbl = GUICtrlCreateButton("分辨率", 168, 16, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$gip = GUICtrlCreateButton("更改IP", 8, 64, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$xtyh = GUICtrlCreateButton("系统优化", 88, 64, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$xgj = GUICtrlCreateButton("小工具", 168, 64, 65, 33, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$help = GUICtrlCreateButton("帮助", 16, 112, 49, 17, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$lxw = GUICtrlCreateButton("联系我", 96, 111, 49, 17, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
$exit = GUICtrlCreateButton("退出", 176, 112, 49, 17, 0)
GUICtrlSetFont(-1, 9, 400, 0, "黑体")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $xthf
                        BOOT() ;恢复系统
                Case $qdaz
                        DRV() ;安装驱动
                Case $fbl
                        RESO() ;设置分辨率
                Case $gip
                        SETIP() ;设置IP
                Case $xtyh
                        OPIT() ;系统垃圾清理和一些优化
                Case $xgj
                        Tool() ;一些系统工具
                Case $help
                       GUISetState(@SW_DISABLE,$Form1) 
                       HELP() ;本程序的说明
                       GUISetState(@SW_ENABLE,$Form1)
                Case $lxw
                        Contact() ;与我联系
                Case $exit
                        Exit
        EndSwitch
WEnd

Func BOOT()
        $a = MsgBox(0, "提示", " 确定 后请您选择您的备份文件,如没备份请先备份!")
If $a Then
Run("E:\Tools\Ghost\boot.exe", "", @SW_HIDE)
Exit
EndIf
EndFunc   ;==>BOOT

Func DRV()
        Run("E:\TOOLS\SkyD9.9es\DrvS3.exe")
EndFunc   ;==>DRV

Func RESO()
        Run("E:\Tools\分辨率\分辨率.exe")
EndFunc   ;==>RESO

Func SETIP()
        Run("E:\Tools\ip\MacToIp1.0.exe")
EndFunc   ;==>SETIP        
        
Func OPIT()
        Run("E:\Tools\系统优化\mstool.exe")
EndFunc   ;==>RESO

Func Tool()
        ShellExecute("E:\Tools\小工具")
EndFunc

Func HELP()
        $form1_2= GUICreate("程序说明", 300, 200, 352, 200)
        $Label1 = GUICtrlCreateLabel("" & @CRLF & "                      说 明" & @CRLF & "" & @CRLF & "" & @CRLF & "1、恢复系统前请您先备份!" & @CRLF & "" & @CRLF & "2、驱动用的是自由天空9.9ES的驱动包." & @CRLF & ""  & @CRLF & "3、设置IP根据需要请修改E:\Tools\IP下的 "& @CRLF &"   Mac2Ip.ini文件,请勿修改文件名!" & @CRLF & "" & @CRLF & "4、这是本人第一个小程序,如有意见请联系我!" & @CRLF & "   我的MAIL:an_8437@163.com QQ:570264002", 0, 0, 400, 300)
        GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
      Switch $nMsg
     Case $GUI_EVENT_CLOSE
      GUIDelete($form1_2)
     WinActivate("$form1_2")
     GUISetState(@SW_ENABLE, $Form1)
       ExitLoop
     EndSwitch
WEnd
EndFunc   ;==>HELP

Func Contact()
        MsgBox(0,"您好","作者MAIL:an_8437@163.com,QQ:570264002"& @CRLF & "欢迎您的意见和建议!")
        Run(@ProgramFilesDir&"\Outlook Express\msimn.exe")
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 

Func Quit()
    GUISetState(@SW_HIDE)
    DllCall($dll, "int:cdecl", "DeInitDecoration")
    DllCall($dll, "int:cdecl", "RemoveSkin")
    DllClose($dll)
        FileDelete(@WindowsDir & "\temp\SkinCrafterDll.dll")
        FileDelete(@WindowsDir & "\temp\vista.skf")
    Exit
EndFunc

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                 FileDelete(@WindowsDir & "\temp\SkinCrafterDll.dll")
             FileDelete(@WindowsDir & "\temp\vista.skf")
                        Exit

        EndSwitch
WEnd
这样试试......

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-1-24 08:31:26 | 显示全部楼层
不明白楼主的意思 看你的代码是单窗口的哦。
发表于 2010-1-24 09:01:14 | 显示全部楼层
也可以改用MsgBox来实现,更加简单
 楼主| 发表于 2010-1-24 12:57:14 | 显示全部楼层
回复 2# lxz

恩 找到原因了。学习了。谢谢!!
发表于 2010-1-24 18:18:20 | 显示全部楼层
楼主,原因是什么啊,这个问题我也没搞定呢。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 02:16 , Processed in 0.145606 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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