本文整理匯總了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