分享

Python windll.user32方法代码示例

 伊伊爸 2022-05-20 发布于湖北

本文整理汇总了Python中ctypes.windll.user32方法的典型用法代码示例。如果您正苦于以下问题:Python windll.user32方法的具体用法?Python windll.user32怎么用?Python windll.user32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ctypes.windll的用法示例。



在下文中一共展示了windll.user32方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: queryMousePosition

# 需要导入模块: from ctypes import windll [as 别名] # 或者: from ctypes.windll import user32 [as 别名] def queryMousePosition(): pt = POINT() windll.user32.GetCursorPos(byref(pt)) return { 'x': pt.x, 'y': pt.y}
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:6,代码来源:mouselogger.py


示例2: run

# 需要导入模块: from ctypes import windll [as 别名]
# 或者: from ctypes.windll import user32 [as 别名]
def run(self):
        if self.install_hook():
            print 'mouselogger installed'
        else:
            raise RuntimeError('couldn't install mouselogger')
        msg = MSG()
        user32.GetMessageA(byref(msg),0,0,0)
        while not self.stopped:
            time.sleep(1)
        self.uninstall_hook() 
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:12,代码来源:mouselogger.py


示例3: hook_proc

# 需要导入模块: from ctypes import windll [as 别名] # 或者: from ctypes.windll import user32 [as 别名] def hook_proc(self, nCode, wParam, lParam): ##http://www./default.aspx/Constants.WM if wParam == 0x201: buf, height, width = self.get_screenshot() self.screenshots.append((datetime.datetime.now(), height, width, buf)) return user32.CallNextHookEx(self.hooked, nCode, wParam, lParam)
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:8,代码来源:mouselogger.py


示例4: __init__

# 需要导入模块: from ctypes import windll [as 别名]
# 或者: from ctypes.windll import user32 [as 别名]
def __init__(self, *args, **kwargs):
        threading.Thread.__init__(self, *args, **kwargs)
        self.hooked  = None
        self.daemon=True
        self.lUser32=user32
        self.pointer=None
        self.stopped=False
        self.screenshots=[] 
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:10,代码来源:mouselogger.py


示例5: set_process_dpi_aware

# 需要导入模块: from ctypes import windll [as 别名] # 或者: from ctypes.windll import user32 [as 别名] def set_process_dpi_aware(): if sys.platform[0:3] == 'win': windll.user32.SetProcessDPIAware(True)
开发者ID:iperov,项目名称:DeepFaceLab,代码行数:5,代码来源:osex.py


示例6: get_screen_size

# 需要导入模块: from ctypes import windll [as 别名]
# 或者: from ctypes.windll import user32 [as 别名]
def get_screen_size():
    if sys.platform[0:3] == 'win':
        user32 = windll.user32
        return user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)
    elif 'darwin' in sys.platform:
        pass
    elif 'linux' in sys.platform:
        pass
        
    return (1366, 768) 
开发者ID:iperov,项目名称:DeepFaceLab,代码行数:12,代码来源:osex.py


示例7: notify_win

# 需要导入模块: from ctypes import windll [as 别名] # 或者: from ctypes.windll import user32 [as 别名] def notify_win(title, text): try: from servo.win32_toast import WindowsToast w = WindowsToast() w.balloon_tip(title, text) except: from ctypes import Structure, windll, POINTER, sizeof from ctypes.wintypes import DWORD, HANDLE, WINFUNCTYPE, BOOL, UINT class FLASHWINDOW(Structure): _fields_ = [('cbSize', UINT), ('hwnd', HANDLE), ('dwFlags', DWORD), ('uCount', UINT), ('dwTimeout', DWORD)] FlashWindowExProto = WINFUNCTYPE(BOOL, POINTER(FLASHWINDOW)) FlashWindowEx = FlashWindowExProto(('FlashWindowEx', windll.user32)) FLASHW_CAPTION = 0x01 FLASHW_TRAY = 0x02 FLASHW_TIMERNOFG = 0x0C params = FLASHWINDOW(sizeof(FLASHWINDOW), windll.kernel32.GetConsoleWindow(), FLASHW_CAPTION | FLASHW_TRAY | FLASHW_TIMERNOFG, 3, 0) FlashWindowEx(params)
开发者ID:paulrouget,项目名称:servoshell,代码行数:28,代码来源:build_commands.py


示例8: __init__

# 需要导入模块: from ctypes import windll [as 别名]
# 或者: from ctypes.windll import user32 [as 别名]
def __init__(self):
        '''Initialize our object'''
        # Find the start x,y pos of the main pygame *screen* (the screen in the
        # window):
        sdlpos = os.getenv('SDL_VIDEO_WINDOW_POS')
        if sdlpos is None:
            raise Exception('Must have previously setup a Pygame window starting position via the 'SDL_VIDEO_WINDOW_POS' evn var.')
        self.initPygameScreenPos = [int(i) for i in sdlpos.split(',')]

        # Run our ctypes code to query window position:
        try:
            # It's said that not all systems support this dictionary key.  I'm
            # not sure what systmes those are, but might as well put a check in.
            self.hwnd = pygame.display.get_wm_info()['window']
        except KeyError:
            raise Exception('Your system isn't accepting the code: 'pygame.display.get_wm_info()[\'window\']', must not be supported :-(')
        self.prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))
        self.paramflags = (1, 'hwnd'), (2, 'lprect')
        self.GetWindowRect = self.prototype(('GetWindowRect', windll.user32), self.paramflags)

        # Find the initial *window* position:
        rect = self.GetWindowRect(self.hwnd)
        # Calculate the thickness of the *window* border to the *screen* object inside:
        self.borderThickness = int(self.initPygameScreenPos[0]) - rect.left
        self.titleThickness = int(self.initPygameScreenPos[1]) - rect.top
        # borderThickness is the left, right, and bottom window edges.  titleThickness
        # is th thickness of the top title-bar of the window. 
开发者ID:Hyphen-ated,项目名称:RebirthItemTracker,代码行数:29,代码来源:pygameWindowInfo.py



注:本文中的ctypes.windll.user32方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多