當前位置: 首頁>>代碼示例>>Python>>正文


Python win32gui.MessageBox方法代碼示例

本文整理匯總了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() 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:20,代碼來源:ShowMessageBox.py

示例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) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:11,代碼來源:copy_hook.py

示例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) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:5,代碼來源:context_menu.py

示例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 
開發者ID:euske,項目名稱:pyrexecd,代碼行數:6,代碼來源:__init__.py

示例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) 
開發者ID:beville,項目名稱:ComicStreamer,代碼行數:14,代碼來源:utils.py

示例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 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:16,代碼來源:ShowMessageBox.py


注:本文中的win32gui.MessageBox方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。