如何做到弹出提示信息后,脚本继续执行
程序要循环执行,有可能会弹出多个提示信息,因为用户可能不在电脑前,无法交互,请问各位大虾要如何做? 回复 1# debu99最根本的办法,也是最简单直接而有效的古龙式经典办法~:不让它弹出提示~~ 晕,这些信息就是用来提醒用户知道的 回复 3# debu99
饿了不一定要吃饭,吃面或者饺子也可以,提示用户也不一样~~ 另外编译一个exe,输出的时候传递参数运行就行了。 回复 5# kxing
一个traytip即可,何必那么麻烦~~ 送个源码给你试试,弹出窗口后不影响后续工作。
_MsgBoxThread('标题', '内容')
Func _MsgBoxThread($sTitle, $sText)
_Msgbox(4096+0x80, $sTitle, $sText, WinGetHandle(AutoItWinGetTitle()), 'shell32.dll', 239)
EndFunc
Func _Msgbox($iFlags, $sTitle, $sText, $hParent = 0, $hInstance = 0, $iIcon = 0);不阻塞msgbox
Local $tMBPs = DllStructCreate('uint Size;hwnd hOwner;ptr hInstance;ptr Text;ptr Caption;dword Style;ptr Icon;dword_ptr ContextHelpId;ptr MsgBoxCallback;dword LanguageId')
Local $Title = DllStructCreate('wchar[' & (StringLen($sTitle) + 1) & ']')
Local $tText = DllStructCreate('wchar[' & (StringLen($sText) + 1) & ']')
Local $tIcon, $hWnd = 0, $Error = 0, $Ret
If ($iIcon) And (BitAND($iFlags, 0x80)) Then
If Not IsString($iIcon) Then $iIcon = '#' & $iIcon
$tIcon = DllStructCreate('wchar[' & (StringLen($iIcon) + 1) & ']')
$hInstance = _WinAPI_GetModuleHandle($hInstance)
If Not $hInstance Then
$Ret = DllCall('kernel32.dll', 'ptr', 'GetModuleHandleW', 'ptr', 0)
If Not @error Then $hInstance = $Ret
EndIf
Else
$tIcon = 0
EndIf
DllStructSetData($Title, 1, $sTitle)
DllStructSetData($tText, 1, $sText)
DllStructSetData($tIcon, 1, $iIcon)
DllStructSetData($tMBPs, 'Size', DllStructGetSize($tMBPs))
DllStructSetData($tMBPs, 'hOwner', $hParent)
DllStructSetData($tMBPs, 'hInstance', $hInstance)
DllStructSetData($tMBPs, 'Text', DllStructGetPtr($tText))
DllStructSetData($tMBPs, 'Caption', DllStructGetPtr($Title))
DllStructSetData($tMBPs, 'Style', $iFlags)
DllStructSetData($tMBPs, 'Icon', DllStructGetPtr($tIcon))
DllStructSetData($tMBPs, 'ContextHelpId', 0)
DllStructSetData($tMBPs, 'MsgBoxCallback', 0)
DllStructSetData($tMBPs, 'LanguageId', 0)
DllCall('kernel32.dll', 'ptr', 'CreateThread', 'ptr', 0, 'dword_ptr', 0, 'ptr', _RTGetProcAddress(_WinAPI_GetModuleHandle('user32.dll'), 'MessageBoxIndirectW'), 'ptr', DllStructGetPtr($tMBPs), 'dword', 0, 'dword*', 0)
Sleep (100)
$tMBPs = 0
$tText = 0
$tIcon = 0
$Title = 0
Return SetError($Error, 0, $hWnd)
EndFunc 用多进程代替多线程 请参考:
http://www.autoitx.com/forum.php?mod=viewthread&tid=36261&rpid=488601&ordertype=0&page=1#pid488601 回复 7# 破帽遮颜
_RTGetProcAddress 未知文件名 用多进程在新的进程里弹出提示 回复 1# debu99
是不是可以加timeout时间 msgbox是阻塞的,但是窗口不是阻塞的,所以你可以自己画个窗口做msgbox来弹出消息,也不需要什么多线程多进程了 我觉得还有一种方法,参照前面几位所说,就是用MsgBox + 多进程技术,在MsgBox弹窗之后,用进程修改MsgBox窗口文本,修改按钮上的文字(比如 在确定按钮后面加个时间),倒计时为0时表示超时,按缺省设置。如果人在的话,提示其选择!
这种方法在很多Ghost系统部署中被使用! 自己整着玩吧,具体的不说了,里面有例子
页:
[1]