找回密码
 加入
搜索
查看: 1782|回复: 4

多窗口操作

[复制链接]
发表于 2008-12-7 16:53:03 | 显示全部楼层 |阅读模式
哪位帮我把下面的两个连起来,我的目的是先运行输入密码窗口,输入正确的密码后运行下一个窗口,先谢了!!

输入密码:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#include <GUIConstantsEx.au3>
$Form1 = GUICreate("输入密码", 299, 110, -1, -1)
$Label1 = GUICtrlCreateLabel("请在下面输入正确的密码:", 24, 24, 148, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlCreateInput("", 24, 64, 137, 21,$ES_PASSWORD)
$Button1 = GUICtrlCreateButton("确  定", 200, 20, 73, 24, 0)
$Button2 = GUICtrlCreateButton("取  消", 200, 64, 73, 24, 0)
GUISetState(@SW_SHOW)
While 1
     $nMsg = GUIGetMsg()
     Switch $nMsg
         Case $GUI_EVENT_CLOSE
             Exit
         Case $Button1
            $pass=GUICtrlRead(4)
               Select
                   Case $pass=""
            msgbox(016,"错误","密码不能为空,请重新输入.")
                   Case $pass<>"123"
                         msgbox(016,"错误","密码不正确,请重新输入.")
                   Case $pass="123"
                       ;运行第二个窗口
             EndSelect
          Case $Button2
             Exit
     EndSwitch
WEnd

第二个窗口:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 323, 141, -1, -1)
$Button1 = GUICtrlCreateButton("打开C盘", 56, 56, 81, 33, 0)
$Button2 = GUICtrlCreateButton("打开D盘", 184, 56, 81, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
              Exit
       Case $Button1
             ShellExecute("C:\")
       Case $Button2
             ShellExecute("D:\")
    EndSwitch
WEnd

[ 本帖最后由 手缺一指 于 2008-12-7 18:38 编辑 ]
 楼主| 发表于 2008-12-7 17:17:15 | 显示全部楼层
这个问题是不是太简单了,还是我没说清楚,怎么没人帮忙啊??
发表于 2008-12-7 18:26:13 | 显示全部楼层
Case $pass="123"
                       GuiDelete()
                       ExitLoop
                       ;运行第二个窗口

应该是这样的吧

#include 的头文件 只要添加一次就行了
 楼主| 发表于 2008-12-7 18:37:44 | 显示全部楼层
感谢楼上的!!
发表于 2009-1-27 00:02:27 | 显示全部楼层
原帖由 文白 于 2008-12-7 18:26 发表
Case $pass="123"
                       GuiDelete()
                       ExitLoop
                       ;运行第二个窗口

应该是这样的吧

#include 的头文件 只要添加一次就行了

;运行第二个窗口 应该怎么写代码呢:
不是把第二个窗口绘制一遍吧!!!!(想重复调用一个窗口)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 01:57 , Processed in 0.076838 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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