本文整理汇总了Python中win32gui.PyMakeBuffer方法的典型用法代码示例。如果您正苦于以下问题:Python win32gui.PyMakeBuffer方法的具体用法?Python win32gui.PyMakeBuffer怎么用?Python win32gui.PyMakeBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32gui
的用法示例。
在下文中一共展示了win32gui.PyMakeBuffer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doubleClickStatic
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PyMakeBuffer [as 别名]
def doubleClickStatic(hwnd):
'''Simulates a double mouse click on a static
Parameters
----------
hwnd
Window handle of the required static.
Usage example: TODO
'''
_sendNotifyMessage(hwnd, win32con.STN_DBLCLK)
# def getEditText(hwnd):
# bufLen = win32gui.SendMessage(hwnd, win32con.WM_GETTEXTLENGTH, 0, 0) + 1
# print(bufLen)
# buffer = win32gui.PyMakeBuffer(bufLen)
# win32gui.SendMessage(hwnd, win32con.WM_GETTEXT, bufLen, buffer)
#
# text = buffer[:bufLen]
# return text
示例2: doubleClickStatic
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PyMakeBuffer [as 别名]
def doubleClickStatic(hwnd):
"""Simulates a double mouse click on a static
Parameters
----------
hwnd
Window handle of the required static.
Usage example: TODO
"""
_sendNotifyMessage(hwnd, win32con.STN_DBLCLK)
# def getEditText(hwnd):
# bufLen = win32gui.SendMessage(hwnd, win32con.WM_GETTEXTLENGTH, 0, 0) + 1
# print(bufLen)
# buffer = win32gui.PyMakeBuffer(bufLen)
# win32gui.SendMessage(hwnd, win32con.WM_GETTEXT, bufLen, buffer)
#
# text = buffer[:bufLen]
# return text
示例3: OnNotify
# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import PyMakeBuffer [as 别名]
def OnNotify(self, hwnd, msg, wparam, lparam):
format = "PPiiiiiiiiP"
buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam)
hwndFrom, idFrom, code, iItem, iSubItem, uNewState, uOldState, uChanged, actionx, actiony, lParam \
= struct.unpack(format, buf)
if code == commctrl.NM_DBLCLK:
print "Double click on item", iItem+1
return 1