adasir 发表于 2010-1-10 00:52:16

MsgBox多线程弹出窗口

我做了一个类似呼叫网管的系统,
使用MsgBox弹出显示窗口,但是如果没点掉第一个弹出窗口,就不能再次弹出窗口,好像程序就中断的,要点掉MsgBox窗口,程序在继续执行
如何才能同时弹出几个MsgBox呢
有没有类似的例子,忘高手指点

ceoguang 发表于 2010-1-10 01:57:44

用多个AdlibRegister或Timer,通过bool变量判断去确定窗口的弹出.不过会对主循环产生影响.

jycel 发表于 2010-1-10 10:23:56

用TrayTip之类的也可以啊!在第二次弹出之前就使用TrayTip("","",0)清空再弹或加个sleep
使用msgbox要暂停的!

顽固不化 发表于 2010-1-10 11:20:41

http://www.autoitx.com/forum.php?mod=viewthread&tid=475&highlight=%B6%E0%BD%F8%B3%CC

试试2楼的例子

ceoguang 发表于 2010-1-10 13:32:05

to LS,那是多进程,非必要时还是不要用的好

顽固不化 发表于 2010-1-10 13:42:49

to LS,那是多进程,非必要时还是不要用的好
ceoguang 发表于 2010-1-10 13:32 http://www.autoitx.com/images/common/back.gif

楼主的意思是:“如何才能同时弹出几个MsgBox呢?”
您是否把楼主的意思理解错了。

ceoguang 发表于 2010-1-11 00:07:56

用多个AdlibRegister或Timer不可以?

298311657 发表于 2010-1-11 00:35:11

msgbox会暂停脚本,不使用多进程,根本无法同时弹出多个msgbox

gapkiller 发表于 2010-1-11 18:22:20

做个exe来弹出message box
然后run这个exe

ceoguang 发表于 2010-1-14 16:37:42

msgbox会暂停脚本,不使用多进程,根本无法同时弹出多个msgbox
298311657 发表于 2010-1-11 00:35 http://www.autoitx.com/images/common/back.gif
试试这个
$Timer = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$TimerDLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 5000, "ptr", DllCallbackGetPtr($Timer))
$Timer2 = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$Timer2DLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 8000, "ptr", DllCallbackGetPtr($Timer2))
$Timer3 = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$Timer3DLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 10000, "ptr", DllCallbackGetPtr($Timer3))
While 1
      GUIGetMsg()
WEnd
Func Timer($hWnd, $uiMsg, $idEvent, $dwTime)
      If $idEvent = $TimerDLL Then
                MsgBox(0,"","线程1")
      ElseIf $idEvent = $Timer2DLL Then
                MsgBox(0,"","线程2")
      ElseIf $idEvent = $Timer3DLL Then
                MsgBox(0,"","线程3")
      EndIf
EndFunc

wgzhi 发表于 2010-1-15 10:42:23

10#的思路正解

yq314 发表于 2010-1-16 19:43:06

貌似au3只能多进程,不支持线程操作?

ceoguang 发表于 2010-1-17 10:54:16

貌似au3只能多进程,不支持线程操作?
yq314 发表于 2010-1-16 19:43 http://www.autoitx.com/images/common/back.gif
是支持操作的,但程序本身不能在多线程里工作

sanmoking 发表于 2010-1-19 14:17:42

据说有个多线程显示msgbox的udf,难道是我记错了,貌似是那个带倒计时的box?

manlty 发表于 2010-7-17 11:45:59

我是通过GUICREAT()来模拟msgbox来实现不中断主循环的前提下,提示信息的
页: [1] 2
查看完整版本: MsgBox多线程弹出窗口