本文整理汇总了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) )
示例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)
示例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
示例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)
示例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
示例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)