a comment explaining foreground issues
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5916 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
130074428e
commit
a4010c1d54
1 changed files with 13 additions and 0 deletions
|
@ -72,6 +72,19 @@ DWORD WINAPI BannerThread(LPVOID lpParameter)
|
|||
HWND hwndParent = (HWND) lpParameter;
|
||||
HWND lhwBanner;
|
||||
|
||||
// This right here is the mother of all evils when it comes to
|
||||
// foreground windows. The dialog is created in another thread
|
||||
// and there can only be one thread holding the right to set the
|
||||
// foreground window. So long as this thread exists and has an
|
||||
// active window, another thread from the same process can steal
|
||||
// its thunder. But if the window and the thread are destroyed,
|
||||
// the foreground rights pass on to another process. To avoid
|
||||
// this situation that could cause the installer to show up on
|
||||
// the background if Banner is used in .onInit, we don't let
|
||||
// CreateDialog show the window and instead do this in the
|
||||
// original thread. This is done by not specifying WS_VISIBLE
|
||||
// for IDD_VERIFY.
|
||||
|
||||
lhwBanner = CreateDialog(
|
||||
GetModuleHandle(0),
|
||||
MAKEINTRESOURCE(IDD_VERIFY),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue