mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-10 21:23:40 +01:00
Windows: Don't use the foreground setting code if the window is already foreground
This commit is contained in:
parent
ece26c7481
commit
1e204da223
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user