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


Python win32api.GetWindowLong方法代碼示例

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


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

示例1: SetStyle

# 需要導入模塊: import win32api [as 別名]
# 或者: from win32api import GetWindowLong [as 別名]
def SetStyle(self, newStyle):
		hwnd = self.listControl.GetSafeHwnd()
		style = win32api.GetWindowLong(hwnd, win32con.GWL_STYLE);
		win32api.SetWindowLong(hwnd, win32con.GWL_STYLE, (style | newStyle) ) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:6,代碼來源:hierlist.py

示例2: OnInitialUpdate

# 需要導入模塊: import win32api [as 別名]
# 或者: from win32api import GetWindowLong [as 別名]
def OnInitialUpdate(self):
		hwnd = self._obj_.GetSafeHwnd()
		style = win32api.GetWindowLong(hwnd, win32con.GWL_STYLE);
		win32api.SetWindowLong(hwnd, win32con.GWL_STYLE, (style & ~commctrl.LVS_TYPEMASK) | commctrl.LVS_REPORT); 

		itemDetails = (commctrl.LVCFMT_LEFT, 100, "Name", 0)
		self.InsertColumn(0, itemDetails)
		itemDetails = (commctrl.LVCFMT_LEFT, 500, "Data", 0)
		self.InsertColumn(1, itemDetails) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:11,代碼來源:regedit.py

示例3: EditValue

# 需要導入模塊: import win32api [as 別名]
# 或者: from win32api import GetWindowLong [as 別名]
def EditValue(self, item):
		# Edit the current value
		class EditDialog(dialog.Dialog):
			def __init__(self, item):
				self.item = item
				dialog.Dialog.__init__(self, win32ui.IDD_LARGE_EDIT)
			def OnInitDialog(self):
				self.SetWindowText("Enter new value")
				self.GetDlgItem(win32con.IDCANCEL).ShowWindow(win32con.SW_SHOW)
				self.edit = self.GetDlgItem(win32ui.IDC_EDIT1)
				# Modify the edit windows style
				style = win32api.GetWindowLong(self.edit.GetSafeHwnd(), win32con.GWL_STYLE)
				style = style & (~win32con.ES_WANTRETURN)
				win32api.SetWindowLong(self.edit.GetSafeHwnd(), win32con.GWL_STYLE, style)
				self.edit.SetWindowText(str(self.item))
				self.edit.SetSel(-1)
				return dialog.Dialog.OnInitDialog(self)
			def OnDestroy(self,msg):
				self.newvalue = self.edit.GetWindowText()
		
		try:
			index = self.GetNextItem(-1, commctrl.LVNI_SELECTED)
		except win32ui.error:
			return # No item selected.

		if index==0:
			keyVal = ""
		else:
			keyVal = self.GetItemText(index,0)
		# Query for a new value.
		try:
			newVal = self.GetItemsCurrentValue(item, keyVal)
		except TypeError, details:
			win32ui.MessageBox(details)
			return 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:37,代碼來源:regedit.py

示例4: _sendNotifyMessage

# 需要導入模塊: import win32api [as 別名]
# 或者: from win32api import GetWindowLong [as 別名]
def _sendNotifyMessage(hwnd, nofifyMessage):
    '''Send a notify message to a control.'''
    win32gui.SendMessage(win32gui.GetParent(hwnd),
                         win32con.WM_COMMAND,
                         _buildWinLong(nofifyMessage,
                                       win32api.GetWindowLong(hwnd,
                                                              win32con.GWL_ID)),
                         hwnd) 
開發者ID:ynzheng,項目名稱:pyautotrade_tdx,代碼行數:10,代碼來源:winguiauto.py

示例5: get_window_list

# 需要導入模塊: import win32api [as 別名]
# 或者: from win32api import GetWindowLong [as 別名]
def get_window_list():
    titles = []
    t = []
    pidList = [(p.pid, p.name()) for p in psutil.process_iter()]

    def enumWindowsProc(hwnd, lParam):
        """ append window titles which match a pid """
        if (lParam is None) or ((lParam is not None) and (win32process.GetWindowThreadProcessId(hwnd)[1] == lParam)):
            text = win32gui.GetWindowText(hwnd)
            if text:
                wStyle = win32api.GetWindowLong(hwnd, win32con.GWL_STYLE)
                if wStyle & win32con.WS_VISIBLE:
                    t.append("%s" % (text))
                    return

    def enumProcWnds(pid=None):
        win32gui.EnumWindows(enumWindowsProc, pid)

    for pid, pName in pidList:
        enumProcWnds(pid)
        if t:
            for title in t:
                titles.append("('{0}', '{1}')".format(pName, title))
            t = []
    titles = sorted(titles, key=lambda x: x[0].lower())
    return titles 
開發者ID:PySimpleGUI,項目名稱:PySimpleGUI,代碼行數:28,代碼來源:Demo_Save_Windows_As_Images.py

示例6: _sendNotifyMessage

# 需要導入模塊: import win32api [as 別名]
# 或者: from win32api import GetWindowLong [as 別名]
def _sendNotifyMessage(hwnd, nofifyMessage):
    """Send a notify message to a control."""
    win32gui.SendMessage(win32gui.GetParent(hwnd),
                         win32con.WM_COMMAND,
                         _buildWinLong(nofifyMessage,
                                       win32api.GetWindowLong(hwnd,
                                                              win32con.GWL_ID)),
                         hwnd) 
開發者ID:drongh,項目名稱:pyAutoTrading,代碼行數:10,代碼來源:winguiauto.py


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