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

[AU3基础] 用ShellExecuteWait运行外部程序时怎样调整它的显示位置

[复制链接]
发表于 2013-1-16 14:10:48 | 显示全部楼层 |阅读模式
本帖最后由 aqtd 于 2013-1-16 14:16 编辑

例如我要运行一个软件,电脑日期和时间又不正确(不上网),先要等到调整好系统统日期后再运行
该软件,我想让系统的调整日期时间的窗口居中显示,怎么办??
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("调整日期/时间", 290, 115, -1, -1)
$Label1 = GUICtrlCreateLabel("当前系统日期:", 16, 24, 88, 17)
$Label2 = GUICtrlCreateLabel("如果日期时间不正确,请修改日期时间", 32, 48, 220, 17)
$Button1 = GUICtrlCreateButton("修改日期/时间", 64, 80, 113, 25)
$Button2 = GUICtrlCreateButton("取消", 216, 80, 57, 25)
$Group1 = GUICtrlCreateGroup("", 8, 0, 273, 73)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label3 = GUICtrlCreateLabel("Label3", 104, 24, 166, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($Label3,@YEAR &"年" &@MON &"月"& @MDAY &"日 " &@HOUR &"时" &@MIN &"分")
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1
                        GUISetState(@SW_HIDE)  ;隐藏主窗口
                        ShellExecuteWait("Timedate.cpl") ;运行调整日期,想让这个窗口居中显示,
                                WinMove("日期和时间 属性","",0,0) ;如果这样的话,上面那个还没关闭,记事本就出来了。
                        Run("notepad.exe")  ;用它测试
                                                ExitLoop
                Case $Button2
            Exit                       
        EndSwitch
WEnd
发表于 2013-1-16 20:04:50 | 显示全部楼层
不明白你想干嘛
发表于 2013-1-21 14:13:31 | 显示全部楼层
回复 1# aqtd
                        GUISetState(@SW_HIDE)  ;隐藏主窗口
                        ShellExecuteWait("Timedate.cpl") ;运行调整日期,想让这个窗口居中显示,
                        WinMove("日期和时间","",300,0) ;如果这样的话,上面那个还没关闭,记事本就出来了。
                                                WinWaitClose("日期和时间")
                        Run("notepad.exe")  ;用它测试
                        ExitLoop
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-1 06:06 , Processed in 0.076401 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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