Page 1 of 1
How to log activated windows?
Posted: 20 Jan 2022, 10:28
by stax76
I've a very annoying defect on my system, sometimes there is a window popping up, and I don't know what it is because it can only be seen for a few milliseconds, I don't see much more than the blinking of the title bar of the currently active application. First I thought it was Anki because I use that a lot, but later I also noticed it in Sublime Text and MusicBee.
If I remember correctly, a Win32 hooking API exists for window activation, or I try to record the screen until it happens. I need to find out which crappy process is the culprit, any ideas for a simple solution?
Re: How to log activated windows?
Posted: 20 Jan 2022, 11:05
by mikeyww
Code: Select all
#SingleInstance Force
Loop {
WinWaitNotActive, A
SoundBeep, 1500
WinGet, proc, ProcessName, A
ToolTip, % list := proc (list ? "`n" : "") list
}
Re: How to log activated windows?
Posted: 20 Jan 2022, 16:07
by amateur+
The God!
Re: How to log activated windows?
Posted: 22 Jan 2022, 02:23
by stax76
@mikeyww
Thanks for helping. I was not able to fix the issue. Meanwhile, I recorded the screen with OBS, and this showed the title bar changes color a few milliseconds indicating that the application loses focus shortly, but there didn't appear another window on screen or in the taskbar, at least not in the recording.
Re: How to log activated windows?
Posted: 22 Jan 2022, 06:04
by boiler
Did mikeyww’s script indicate any changes in the active window? You haven’t mentioned that you used it.
Re: How to log activated windows?
Posted: 22 Jan 2022, 07:39
by swagfag
that script relies on the window actually becoming the foreground window. if it doesnt do that, then nothing gets logged obviously
if that is the case, u can monitor window creation using a WinEventHook
Re: How to log activated windows?
Posted: 22 Jan 2022, 10:30
by amateur+
Maybe this will work?
Code: Select all
#SingleInstance Force
Loop {
oldActive := WinExist("A")
WinWaitNotActive, A
while !(newActive := WinExist("A")) || (newActive = oldActive)
Sleep 0
WinGet, proc, ProcessName, A
ToolTip, % list := proc (list ? "`n" : "") list
}