当前位置: 首页>>代码示例>>Python>>正文


Python wintypes.MSG属性代码示例

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


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

示例1: startKeyLog

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def startKeyLog(self):                                                                
        msg = MSG()
        ctypes.windll.user32.GetMessageA(ctypes.byref(msg),0,0,0) 
开发者ID:maldevel,项目名称:gdog,代码行数:5,代码来源:client.py

示例2: run_windows

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def run_windows(self):
        from ctypes.wintypes import DWORD, WPARAM, LPARAM, MSG

        class KBDLLHOOKSTRUCT(Structure):
            _fields_ = [
                ("vk_code", DWORD),
                ("scan_code", DWORD),
                ("flags", DWORD),
                ("time", c_int),
                ("dwExtraInfo", POINTER(DWORD))
            ]

        def callback(nCode, wParam, lParam):
            pid = c_ulong()
            windll.user32.GetWindowThreadProcessId(windll.user32.GetForegroundWindow(), byref(pid))
            if pid.value == self.pid:
                windll.user32.SendMessageA(self.window.winId(), wParam, lParam.contents.vk_code, 0)
            return windll.user32.CallNextHookEx(None, nCode, wParam, lParam)
 
        function = CFUNCTYPE(c_int, WPARAM, LPARAM, POINTER(KBDLLHOOKSTRUCT))(callback)
        hook = windll.user32.SetWindowsHookExW(13, function, windll.kernel32.GetModuleHandleW(None), 0)

        msg = POINTER(MSG)()
        while self.running:
            try:
                windll.user32.GetMessageW(msg, 0, 0, 0)
                windll.user32.TranslateMessage(msg)
                windll.user32.DispatchMessageA(msg)
            except: pass

        windll.user32.UnhookWindowsHookEx(hook) 
开发者ID:RiotGames,项目名称:leaguedirector,代码行数:33,代码来源:bindings.py

示例3: startKeyLog

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def startKeyLog(self):                                                                
         msg = MSG()
         ctypes.windll.user32.GetMessageA(ctypes.byref(msg),0,0,0) 
开发者ID:byt3bl33d3r,项目名称:gcat,代码行数:5,代码来源:implant.py

示例4: listen

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def listen(self):
        while True:
            message = wintypes.MSG()
            message_pointer = ctypes.byref(message)

            if GetMessage(message_pointer, None, 0, 0) <= 0 or message.message == 0x0401:
                break 
开发者ID:SerpentAI,项目名称:sneakysnek,代码行数:9,代码来源:windows_recorder.py

示例5: run

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

示例6: run

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [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

示例7: WinMSGLoop

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def WinMSGLoop():
    """Run the main windows message loop."""
    LPMSG = POINTER(MSG)
    LRESULT = c_ulong
    GetMessage = get_winfunc("user32", "GetMessageW", BOOL, (LPMSG, HWND, UINT, UINT))
    TranslateMessage = get_winfunc("user32", "TranslateMessage", BOOL, (LPMSG,))
    # restype = LRESULT
    DispatchMessage = get_winfunc("user32", "DispatchMessageW", LRESULT, (LPMSG,))

    msg = MSG()
    lpmsg = byref(msg)
    while GetMessage(lpmsg, HWND(), 0, 0) > 0:
        TranslateMessage(lpmsg)
        DispatchMessage(lpmsg) 
开发者ID:devcartel,项目名称:pymt5,代码行数:16,代码来源:ddeclient.py

示例8: handle_hotkey

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def handle_hotkey(root, callback):
        msg = wintypes.MSG()
        if windll.user32.GetMessageA(byref(msg), None, 0, 0) != 0:
            if msg.message == win32con.WM_HOTKEY:
                if msg.wParam == 1:
                    print 'Hotkey triggered!'
                    callback()
        windll.user32.TranslateMessage(byref(msg))
        windll.user32.DispatchMessageA(byref(msg))
        root.after(1, handle_hotkey, root, callback)

    # hotkey map refs: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
    # not yet used here. 
开发者ID:NetEaseGame,项目名称:ATX,代码行数:15,代码来源:tkinput.py

示例9: WinMSGLoop

# 需要导入模块: from ctypes import wintypes [as 别名]
# 或者: from ctypes.wintypes import MSG [as 别名]
def WinMSGLoop():
    """Run the main windows message loop."""
    from ctypes import POINTER, byref, c_ulong
    from ctypes.wintypes import BOOL, HWND, MSG, UINT

    LPMSG = POINTER(MSG)
    LRESULT = c_ulong
    GetMessage = get_winfunc(
        "user32",
        "GetMessageW",
        BOOL,
        (LPMSG, HWND, UINT, UINT)
    )
    TranslateMessage = get_winfunc(
        "user32",
        "TranslateMessage",
        BOOL,
        (LPMSG,)
    )
    # restype = LRESULT
    DispatchMessage = get_winfunc(
        "user32",
        "DispatchMessageW",
        LRESULT,
        (LPMSG,)
    )

    msg = MSG()
    lpmsg = byref(msg)
    while GetMessage(lpmsg, HWND(), 0, 0) > 0:
        TranslateMessage(lpmsg)
        DispatchMessage(lpmsg) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:34,代码来源:dde.py


注:本文中的ctypes.wintypes.MSG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。