(self, hwnd, msg, wparam, lparam)
return 1
Receive click events from the taskbar.
Receive click events from the taskbar.
Receive click events from the taskbar .
def OnTaskbarNotify(self, hwnd, msg, wparam, lparam):
        """Receive click events from the taskbar."""
        
        #Left click
        if lparam==win32con.WM_LBUTTONUP:
            pass
            
        #Double click (bring to front)
        elif lparam==win32con.WM_LBUTTONDBLCLK:
            
            always_bring_to_front = True
            
            if always_bring_to_front or self.console_hwnd is not None and self.console_hwnd.minimised:
                self.logger.info('Double click to bring window to foreground.')
                self.bring_to_front()
            else:
                self.logger.info('Double click to minimise window.')
                self.minimise_to_tray()
        
        #Right click (load menu)
        elif lparam==win32con.WM_RBUTTONUP:
            self.logger.info('Right click to open menu.')

            for func in self._commands['OnMenuOpen']:
                self.logger.debug('Called "%s" after opening menu.', func.__name__)
                func(self)
            
            #Occasionally the menu may fail to load for some reason, so skip
            try:
                self.show_menu()
            except pywintypes.error:
                return 0
                
            for func in self._commands['OnMenuClose']:
                self.logger.debug('Called "%s" after closing menu.', func.__name__)
                func(self)
        return 1
def OnTaskbarNotify ( self , hwnd , msg , wparam , lparam ) : #Left click if lparam == win32con . WM_LBUTTONUP : pass #Double click (bring to front) elif lparam == win32con . WM_LBUTTONDBLCLK : always_bring_to_front = True if always_bring_to_front or self . console_hwnd is not None and self . console_hwnd . minimised : self . logger . info ( 'Double click to bring window to foreground.' ) self . bring_to_front ( ) else : self . logger . info ( 'Double click to minimise window.' ) self . minimise_to_tray ( ) #Right click (load menu) elif lparam == win32con . WM_RBUTTONUP : self . logger . info ( 'Right click to open menu.' ) for func in self . _commands [ 'OnMenuOpen' ] : self . logger . debug ( 'Called "%s" after opening menu.' , func . __name__ ) func ( self ) #Occasionally the menu may fail to load for some reason, so skip try : self . show_menu ( ) except pywintypes . error : return 0 for func in self . _commands [ 'OnMenuClose' ] : self . logger . debug ( 'Called "%s" after closing menu.' , func . __name__ ) func ( self ) return 1