1
a while ago something weird started happening, when pressing Ctrl or Alt Gr focus is changed. I've found several resources which don't address how to find the actual process but rather how to block applications from doing so, which doesn't seem like a good solution.
Again, I've actually researched and found nothing but hacks to the actual problem, this is not a duplicate.
I've prepared a small app which detects when focus changes. As far as I can tell, it happens on all applications I have installed. Below is a copy of Visual Studio's output window (with the app I've setup running):
How I reproduced the issue:
- Manually focused the Notepad Window (log #1 showed up).
- Pressed ctrl, both the thread related log and log #2 showed up.
Output Window content:
1 - Window Handle: 723652 | Process: notepad | Window: Untitled - Notepad | Exe file: C:\Windows\system32\notepad.exe The thread 0xafc has exited with code 259 (0x103). 2 - Window Handle: 526994 | Process: notepad | Window: Untitled - Notepad | Exe file: C:\Windows\system32\notepad.exe
What I've tried:
- After focus being lost pressing ALT + F4, trying to close the process. [before coming up with the app].
- Used Process Explorer to try to identify the process (but since I can't close it, no help at all)
What I think it's happening:
- Since when the issue occurs no other process is receiving the focus, it must be assigning it a null value and re-assigning to the old window, even though it doesn't actually regains focus, but according to the app it does; i.e: the border is greyed out and I can't interact with the window unless I click it again even though it should be focused again.
What can I do in order to identify the process and not just prevent applications from changing focus?