Python ctypes.windll.user32() Examples
The following are 15
code examples of ctypes.windll.user32().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
ctypes.windll
, or try the search function
.
Example #1
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 8 votes |
def queryMousePosition(): pt = POINT() windll.user32.GetCursorPos(byref(pt)) return { "x": pt.x, "y": pt.y}
Example #2
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 6 votes |
def queryMousePosition(): pt = POINT() windll.user32.GetCursorPos(byref(pt)) return { "x": pt.x, "y": pt.y}
Example #3
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 5 votes |
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=[]
Example #4
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 5 votes |
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()
Example #5
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 5 votes |
def hook_proc(self, nCode, wParam, lParam): ##http://www.pinvoke.net/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)
Example #6
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 5 votes |
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()
Example #7
Source File: osex.py From DeepFaceLab with GNU General Public License v3.0 | 5 votes |
def set_process_dpi_aware(): if sys.platform[0:3] == 'win': windll.user32.SetProcessDPIAware(True)
Example #8
Source File: osex.py From DeepFaceLab with GNU General Public License v3.0 | 5 votes |
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)
Example #9
Source File: build_commands.py From servoshell with Mozilla Public License 2.0 | 5 votes |
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)
Example #10
Source File: pygameWindowInfo.py From RebirthItemTracker with BSD 2-Clause "Simplified" License | 5 votes |
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.
Example #11
Source File: mouselogger.py From backdoorme with MIT License | 5 votes |
def queryMousePosition(): pt = POINT() windll.user32.GetCursorPos(byref(pt)) return { "x": pt.x, "y": pt.y}
Example #12
Source File: mouselogger.py From backdoorme with MIT License | 5 votes |
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=[]
Example #13
Source File: mouselogger.py From backdoorme with MIT License | 5 votes |
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()
Example #14
Source File: mouselogger.py From backdoorme with MIT License | 5 votes |
def hook_proc(self, nCode, wParam, lParam): ##http://www.pinvoke.net/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)
Example #15
Source File: mouselogger.py From NoobSec-Toolkit with GNU General Public License v2.0 | 4 votes |
def hook_proc(self, nCode, wParam, lParam): ##http://www.pinvoke.net/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)