This repository was 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
hmemcpy wants to merge 1 commit intoXhmikosR:masterfrom
hmemcpy:relaunch-elevated-visible-fix
Open
RelaunchElevated will always launch a process with a visible window#153hmemcpy wants to merge 1 commit intoXhmikosR:masterfrom hmemcpy:relaunch-elevated-visible-fix
hmemcpy wants to merge 1 commit intoXhmikosR:masterfrom
hmemcpy:relaunch-elevated-visible-fix
Conversation
Author
|
Turns out I inadvertently found a bug in Visual Studio 2015 :) |
Owner
|
So, is this valid, or not? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I stumbled upon an issue that drove me bit nuts over the weekend: if I called RelaunchElevated (by passing
/uor 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.wShowWindowwas 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_SHOWNORMALto the child process, making sure its window is always visible.