Python win32gui 模块,MessageBox() 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用win32gui.MessageBox()

项目:KeyCounter    作者:Microcore    | 项目源码 | 文件源码
def instance_running(self):
        '''
        Use CreateEvent to make sure there is only one instance running
        '''
        if self.SICHECK_EVENT is None:
            self.SICHECK_EVENT = win32event.CreateEvent(
                None, 1, 0, self.GUID
            )
            # An instance is already running, quit
            if win32api.GetLastError() == winerror.ERROR_ALREADY_EXISTS:
                win32gui.MessageBox(
                    self.HWND,
                    'You can only run one instance at a time',
                    'Seems like KeyCounter is already running',
                    win32con.MB_OK
                )
                return self.stop()
项目:Email_My_PC    作者:Jackeriss    | 项目源码 | 文件源码
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)
项目:Email_My_PC    作者:Jackeriss    | 项目源码 | 文件源码
def InvokeCommand(self, ci):
        mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci
        win32gui.MessageBox(hwnd, "Hello", "Wow", win32con.MB_OK)
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
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)
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def InvokeCommand(self, ci):
        mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci
        win32gui.MessageBox(hwnd, "Hello", "Wow", win32con.MB_OK)
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
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)
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def InvokeCommand(self, ci):
        mask, hwnd, verb, params, dir, nShow, hotkey, hicon = ci
        win32gui.MessageBox(hwnd, "Hello", "Wow", win32con.MB_OK)
项目:Automation-Framework-for-devices    作者:tok-gogogo    | 项目源码 | 文件源码
def pause(self, string = "Click to Continue test"):
        """ Wait for the user to click a button to continue testing.
            parameters:
                [string]  = Message to display to user
            returns:
                None
        """
        self._wait()
        try:
           win32gui.MessageBox(0, string, "Pausing test...", 0)
        except:
            (ErrorType,ErrorValue,ErrorTB)=sys.exc_info()
            print sys.exc_info()
            traceback.print_exc(ErrorTB)
        else:   return True
项目:Automation-Framework-for-devices    作者:tok-gogogo    | 项目源码 | 文件源码
def pause(self, string = "Click to Continue test"):
        """ Wait for the user to click a button to continue testing.
            parameters:
                [string]  = Message to display to user
            returns:
                None
        """
        self._wait()
        try:
           win32gui.MessageBox(0, string, "Pausing test...", 0)
        except:
            (ErrorType,ErrorValue,ErrorTB)=sys.exc_info()
            print (sys.exc_info())
            traceback.print_exc(ErrorTB)
        else:   return True