本文整理汇总了Python中win32gui.MessageBox方法的典型用法代码示例。如果您正苦于以下问题:Python win32gui.MessageBox方法的具体用法?Python win32gui.MessageBox怎么用?Python win32gui.MessageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32gui
的用法示例。
在下文中一共展示了win32gui.MessageBox方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onClose
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MessageBox [as 别名]
def onClose(self, evt):
retCode = self.GetReturnCode()
if retCode not in self.LABELS:
return
if self.timer:
self.timer.Stop()
del self.timer
ix = 1 + self.action.RES_IDS.index(retCode) if retCode in self.action.RES_IDS else 1
result = self.action.RESULTS[ix]
self.alias = self.alias if self.alias else self.title
if self.payload:
eg.TriggerEvent("%s.%s" % (self.alias, result), self.payload, "MessageBox")
else:
eg.TriggerEvent("%s.%s" % (self.alias, result), prefix = "MessageBox")
if self.event is not None:
self.action.retCode = result
SetEvent(self.event)
self.Destroy()
示例2: CopyCallBack
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MessageBox [as 别名]
def CopyCallBack(self, hwnd, func, flags,
srcName, srcAttr, destName, destAttr):
# This function should return:
# IDYES Allows the operation.
# IDNO Prevents the operation on this folder but continues with any other operations that have been approved (for example, a batch copy operation).
# IDCANCEL Prevents the current operation and cancels any pending operations.
print "CopyCallBack", hwnd, func, flags, srcName, srcAttr, destName, destAttr
return win32gui.MessageBox(hwnd, "Allow operation?", "CopyHook",
win32con.MB_YESNO)
示例3: InvokeCommand
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MessageBox [as 别名]
def InvokeCommand(self, ci):
mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci
win32gui.MessageBox(hwnd, "Hello", "Wow", win32con.MB_OK)
示例4: msgbox
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MessageBox [as 别名]
def msgbox(text, caption='Error'):
win32gui.MessageBox(None, text, caption,
(win32con.MB_OK | win32con.MB_ICONERROR))
return
示例5: alert
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MessageBox [as 别名]
def alert(title, msg):
if getattr(sys, 'frozen', None):
if platform.system() == "Darwin":
import Tkinter, tkMessageBox
root = Tkinter.Tk()
root.lift()
root.attributes('-topmost', 1)
root.withdraw()
tkMessageBox.showinfo(title, msg)
elif platform.system() == "Windows":
import win32gui
win32gui.MessageBox(0,msg,title,0)
示例6: showMessageBox
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MessageBox [as 别名]
def showMessageBox(self, title, body, alias, payload, options):
if not alias:
alias = title
result = MessageBox(0, body, title, options)
if result > 0 and result < 8:
result = self.RESULTS[result]
else:
result = str(result)
if payload:
eg.TriggerEvent("%s.%s" % (alias, result), payload, "MessageBox")
else:
eg.TriggerEvent("%s.%s" % (alias, result), prefix = "MessageBox")
return result