Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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

wants to merge 1 commit into from

Conversation

hmemcpy
Copy link

@hmemcpy hmemcpy commented Apr 30, 2016

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
Copy link
Author

hmemcpy commented Apr 30, 2016

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

@XhmikosR
Copy link
Owner

So, is this valid, or not?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants