|
edit: nevermind, i figured it out myself!! Humble Request Problem: My C or C++ is 20 years out of date and I don't really feel like brushing up on them or learning how Windows works right now. I'd like something to do this: nielsm posted:Possibly a hook: SetWindowsHookEx with WH_CALLWNDPROCRET, look for WM_CREATE and WM_DESTROY messages. Basically, I'm looking to automate some stuff in python when different windows are opened and enumerating all windows in a loop is either slow or CPU intenstive. AFAICT, no one has done any work on getting SetWindowsHookEx to work in python. Or I guess this? Bonfire Lit posted:SetWindowsHookEx has some requirements that make it unwieldy (like having the hook code in a DLL so it can be injected). If you only want to track windows getting created/destroyed, you can use the accessibility functions (SetWinEventHook). Description and requirements: At a minimum it would just sit there printing to stdout a message when any window was created or destroyed. Probably would be ideal if it printed the handle and possibly the title...not sure if this info is part of the payload of this hook. I could just run this via python and watch the messages. Nice to have features:
Thermopyle fucked around with this message at 22:49 on Apr 8, 2019 |
# ¿ Apr 6, 2019 22:18 |
|
|
# ¿ May 21, 2024 02:11 |