WinSetTitle的问题,有点想不通,大家帮忙看一下
WinWait("大智慧", "")If WinActive("大智慧", "") Then WinActivate("大智慧", "")
;Sleep(5000)
$tmp = WinExists("大智慧", "")
ConsoleWrite($tmp)
$tmp = WinSetTitle("大智慧", "", $newTitle)
ConsoleWrite($tmp)
此问题比较郁闷,
第一个ConsoleWrite($tmp)的值返回始终是1
为什么我这里一定要Sleep(5000)才能够SetTitle成功,并且即使成功了,第二个ConsoleWrite($tmp)返回0
困扰了我好久,大家帮我看一看,
提前祝大家小年快乐 有些程序会在没有完全启动时对标题有操作,这时改了也会被改回来,或改不了 加个循环判断比较好。节省时间
run("notepad.exe")
WinWaitActive("无标题")
$winhd=WinGetHandle("无标题")
While StringInStr(WinGetTitle($winhd),"无标题")
WinSetTitle($winhd,"","我的记事本")
WEnd 感谢大家~~~~
页:
[1]