Closed navhaxs closed 5 years ago
@susam, maybe this could be merged? :)
Thank you, Jeremy (@navhaxs), for creating this pull request and thank you, Mikkel (@Madsn), for reminding me to merge this. Sorry, it took so long to take a look at this pull request. I've not had a Windows laptop with me in the last couple of years, so that's why I it took so long. Finally, today I created a Windows 10 Pro virtual machine on Azure to reproduce this issue and test this pull request.
The root cause of the issue here is that in the presence of Cmder, the FindWindow("ConsoleWindowClass", NULL) call gets a handle to another window (not the window in which Uncap is running), so the ShowWindow(h, SW_HIDE) call later attempts to hide the wrong window instead of the window in which Uncap is running. I will push another fix later that addresses this root cause.
For now, I am merging this pull request as is, so that it remains in the commit history of this project. This pull request resolves the issue by working around the issue with the FreeConsole()
call that detaches Uncap from the console regardless of which handle we got with the FindWindow()
call.
Fix for https://github.com/susam/uncap/issues/6
Steps to reproduce:
uncap.exe
from a File Explorer - rather than launching from a consoleThe issue is likely to do with ConEmu's hooking of consoles, but didn't investigate further since this simple fix worked for me