當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。