当前位置: 首页>>代码示例>>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;未经允许,请勿转载。