XhmikosR / notepad2-mod

LOOKING FOR DEVELOPERS - Notepad2-mod, a Notepad2 fork, a fast and light-weight Notepad-like text editor with syntax highlighting
https://xhmikosr.github.io/notepad2-mod/
Other
1.45k stars 270 forks source link

RelaunchElevated will always launch a process with a visible window #153

Open hmemcpy opened 8 years ago

hmemcpy commented 8 years ago

I stumbled upon an issue that drove me bit nuts over the weekend: if I called RelaunchElevated (by passing /u or manually), while launching from Visual Studio (with or without a debugger), the child process launched, but it didn't have any visible windows! Upon further investigation I found that the value of STARTUPINFO.wShowWindow was 0 for some reason, when running from VS (it corresponds to SW_HIDE). When launched from a cmd shell it had a value 1. Having no idea why this happens, I asked this question on StackOverflow https://stackoverflow.com/questions/36953886/startupinfo-wshowwindow-is-0-when-running-from-visual-studio

In the meantime, here's a fix that will pass SW_SHOWNORMAL to the child process, making sure its window is always visible.

hmemcpy commented 8 years ago

Turns out I inadvertently found a bug in Visual Studio 2015 :)

XhmikosR commented 8 years ago

So, is this valid, or not?