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


Python win32con.WM_LBUTTONDBLCLK屬性代碼示例

本文整理匯總了Python中win32con.WM_LBUTTONDBLCLK屬性的典型用法代碼示例。如果您正苦於以下問題:Python win32con.WM_LBUTTONDBLCLK屬性的具體用法?Python win32con.WM_LBUTTONDBLCLK怎麽用?Python win32con.WM_LBUTTONDBLCLK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在win32con的用法示例。


在下文中一共展示了win32con.WM_LBUTTONDBLCLK屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: OnTaskbarNotify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def OnTaskbarNotify(self, hwnd, msg, wparam, lparam):
        if lparam==win32con.WM_RBUTTONUP:
            print "You right clicked me."
            # display the menu at the cursor pos.
            pos = GetCursorPos()
            SetForegroundWindow(self.hwnd)
            TrackPopupMenu(self.hmenu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None)
            PostMessage(self.hwnd, win32con.WM_NULL, 0, 0)
        elif lparam==win32con.WM_LBUTTONDBLCLK:
            print "You double-clicked me"
            # find the default menu item and fire it.
            cmd = GetMenuDefaultItem(self.hmenu, False, 0)
            if cmd == -1:
                print "Can't find a default!"
            # and just pretend it came from the menu
            self.OnCommand(hwnd, win32con.WM_COMMAND, cmd, 0)
        return 1 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:19,代碼來源:win32gui_menu.py

示例2: _notify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def _notify(klass, hwnd, msg, wparam, lparam):
        self = klass._instance[hwnd]
        if lparam == win32con.WM_LBUTTONDBLCLK:
            menu = self.get_popup()
            wid = win32gui.GetMenuDefaultItem(menu, 0, 0)
            if 0 < wid:
                win32gui.PostMessage(hwnd, win32con.WM_COMMAND, wid, 0)
        elif lparam == win32con.WM_RBUTTONUP:
            menu = self.get_popup()
            pos = win32gui.GetCursorPos()
            win32gui.SetForegroundWindow(hwnd)
            win32gui.TrackPopupMenu(
                menu, win32con.TPM_LEFTALIGN,
                pos[0], pos[1], 0, hwnd, None)
            win32gui.PostMessage(hwnd, win32con.WM_NULL, 0, 0)
        elif lparam == win32con.WM_LBUTTONUP:
            pass
        return True 
開發者ID:euske,項目名稱:pyrexecd,代碼行數:20,代碼來源:__init__.py

示例3: HookMessages

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def HookMessages(self):
		self.HookMessage(self.OnLButtonUp, win32con.WM_LBUTTONUP)
		self.HookMessage(self.OnLButtonDown, win32con.WM_LBUTTONDOWN)
		self.HookMessage(self.OnLButtonDblClk, win32con.WM_LBUTTONDBLCLK)
		self.HookMessage(self.OnNcLButtonDown, win32con.WM_NCLBUTTONDOWN)
		self.HookMessage(self.OnNcLButtonDblClk, win32con.WM_NCLBUTTONDBLCLK)
		self.HookMessage(self.OnMouseMove, win32con.WM_MOUSEMOVE)
		self.HookMessage(self.OnNcPaint, win32con.WM_NCPAINT)
		self.HookMessage(self.OnCaptureChanged, win32con.WM_CAPTURECHANGED)
		self.HookMessage(self.OnWindowPosChanged, win32con.WM_WINDOWPOSCHANGED)
#		self.HookMessage(self.OnSize, win32con.WM_SIZE) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:13,代碼來源:DockingBar.py

示例4: HookHandlers

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def HookHandlers(self):
        self.HookMessage(self.OnRClick, win32con.WM_RBUTTONDOWN)
        self.HookCommand(self.OnCmdOpenFile, ID_OPEN_FILE)
        self.HookCommand(self.OnCmdThe, ID_PYCHECKER)
        self.HookCommand(self.OnCmdSave, ID_SAVERESULTS)
        self.HookCommand(self.OnTryAgain, ID_TRYAGAIN)
        self.HookCommand(self.OnAddComment, ID_ADDCOMMENT)
        self.HookCommand(self.OnAddComment, ID_ADDPYCHECKNO2)
        self.HookMessage(self.OnLDblClick,win32con.WM_LBUTTONDBLCLK) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:11,代碼來源:mdi_pychecker.py

示例5: HookHandlers

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def HookHandlers(self):
		self.HookMessage(self.OnRClick, win32con.WM_RBUTTONDOWN)
		self.HookCommand(self.OnCmdOpenFile, ID_OPEN_FILE)
		self.HookCommand(self.OnCmdGrep, ID_GREP)
		self.HookCommand(self.OnCmdSave, ID_SAVERESULTS)
		self.HookCommand(self.OnTryAgain, ID_TRYAGAIN)
		self.HookMessage(self.OnLDblClick,win32con.WM_LBUTTONDBLCLK) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:9,代碼來源:sgrepmdi.py

示例6: HookHandlers

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def HookHandlers(self):
		WindowOutputViewImpl.HookHandlers(self)
		# Hook for finding and locating error messages
		self.HookMessage(self.OnLDoubleClick,win32con.WM_LBUTTONDBLCLK)
#		docview.RichEditView.HookHandlers(self) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:7,代碼來源:winout.py

示例7: notify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def notify(self, hwnd, msg, wparam, lparam):
        if lparam == win32con.WM_LBUTTONDBLCLK:
            self.execute_menu_option(self.default_menu_index + self.FIRST_ID)
        elif lparam == win32con.WM_RBUTTONUP:
            self.show_menu()
        elif lparam == win32con.WM_LBUTTONUP:
            pass
        return True 
開發者ID:samclane,項目名稱:LIFX-Control-Panel,代碼行數:10,代碼來源:SysTrayIcon.py

示例8: OnTaskbarNotify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
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 
開發者ID:Peter92,項目名稱:MouseTracks,代碼行數:39,代碼來源:tray.py

示例9: OnTaskbarNotify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def OnTaskbarNotify(self, hwnd, msg, wparam, lparam):
        if lparam == win32con.WM_LBUTTONDBLCLK:
            self.execute_menu_option(_FIRST_ID)
        elif lparam == win32con.WM_RBUTTONUP:
            self.status_icon.show_menu()
        # elif lparam == win32con.WM_LBUTTONUP:
        #    self._show_console()

        return True 
開發者ID:eavatar,項目名稱:eavatar-me,代碼行數:11,代碼來源:shell.py

示例10: notify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def notify(self, hwnd, msg, wparam, lparam):
        if lparam==win32con.WM_LBUTTONDBLCLK:
            self.execute_menu_option(self.default_menu_index + self.FIRST_ID)
        elif lparam==win32con.WM_RBUTTONUP:
            self.show_menu()
        elif lparam==win32con.WM_LBUTTONUP:
            self.show_menu()
        return True 
開發者ID:beville,項目名稱:ComicStreamer,代碼行數:10,代碼來源:gui_win.py

示例11: OnTaskbarNotify

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import WM_LBUTTONDBLCLK [as 別名]
def OnTaskbarNotify(
        self,
        hwnd,
        msg,
        wparam,
        lparam,
    ):
        if lparam == win32con.WM_LBUTTONUP:
            pass
        elif lparam == win32con.WM_LBUTTONDBLCLK:
            pass
        elif lparam == win32con.WM_RBUTTONUP:
            menu = win32gui.CreatePopupMenu()
            win32gui.AppendMenu(menu, win32con.MF_STRING, 1023,
                                'Toggle Display')
            win32gui.AppendMenu(menu, win32con.MF_SEPARATOR, 0, '')
            if self.serverState == self.EnumServerState.STOPPED:
                win32gui.AppendMenu(menu, win32con.MF_STRING, 1024,
                                    'Start Server')
                win32gui.AppendMenu(menu, win32con.MF_STRING
                                    | win32con.MF_GRAYED, 1025,
                                    'Restart Server')
                win32gui.AppendMenu(menu, win32con.MF_STRING
                                    | win32con.MF_GRAYED, 1026,
                                    'Stop Server')
            else:
                win32gui.AppendMenu(menu, win32con.MF_STRING
                                    | win32con.MF_GRAYED, 1024,
                                    'Start Server')
                win32gui.AppendMenu(menu, win32con.MF_STRING, 1025,
                                    'Restart Server')
                win32gui.AppendMenu(menu, win32con.MF_STRING, 1026,
                                    'Stop Server')
            win32gui.AppendMenu(menu, win32con.MF_SEPARATOR, 0, '')
            win32gui.AppendMenu(menu, win32con.MF_STRING, 1027,
                                'Quit (pid:%i)' % os.getpid())
            pos = win32gui.GetCursorPos()

            # See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/menus_0hdi.asp

            win32gui.SetForegroundWindow(self.hwnd)
            win32gui.TrackPopupMenu(
                menu,
                win32con.TPM_LEFTALIGN,
                pos[0],
                pos[1],
                0,
                self.hwnd,
                None,
            )
            win32api.PostMessage(self.hwnd, win32con.WM_NULL, 0, 0)
        return 1 
開發者ID:uwdata,項目名稱:termite-visualizations,代碼行數:54,代碼來源:taskbar_widget.py


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