mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: Don't use the foreground setting code if the window is already foreground
This commit is contained in:
@@ -6954,6 +6954,8 @@ void BringToForeground(HWND hWnd)
|
|||||||
DWORD dwThisTID = ::GetCurrentThreadId(),
|
DWORD dwThisTID = ::GetCurrentThreadId(),
|
||||||
dwCurrTID = ::GetWindowThreadProcessId(hCurrWnd,0);
|
dwCurrTID = ::GetWindowThreadProcessId(hCurrWnd,0);
|
||||||
|
|
||||||
|
if (hCurrWnd != hWnd)
|
||||||
|
{
|
||||||
if(dwThisTID != dwCurrTID)
|
if(dwThisTID != dwCurrTID)
|
||||||
{
|
{
|
||||||
::AttachThreadInput(dwThisTID, dwCurrTID, TRUE);
|
::AttachThreadInput(dwThisTID, dwCurrTID, TRUE);
|
||||||
@@ -6971,6 +6973,7 @@ void BringToForeground(HWND hWnd)
|
|||||||
::SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,(PVOID)lockTimeOut,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
|
::SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,(PVOID)lockTimeOut,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
|
||||||
::AttachThreadInput(dwThisTID, dwCurrTID, FALSE);
|
::AttachThreadInput(dwThisTID, dwCurrTID, FALSE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TCMOUNT
|
#ifdef TCMOUNT
|
||||||
if (hWnd == MainDlg)
|
if (hWnd == MainDlg)
|
||||||
|
|||||||
Reference in New Issue
Block a user