mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 10:11:52 +03:00
Fixed single instance bug
This commit is contained in:
parent
a348befb3d
commit
14afe02125
@ -110,7 +110,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title,
|
|||||||
// Attempt to create a mutex to enforce single instance.
|
// Attempt to create a mutex to enforce single instance.
|
||||||
CreateMutex(NULL, TRUE, L"com.yubico.authenticator.mutex");
|
CreateMutex(NULL, TRUE, L"com.yubico.authenticator.mutex");
|
||||||
if (GetLastError() == ERROR_ALREADY_EXISTS) {
|
if (GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||||
HWND handle=FindWindowA(NULL, "Yubico Authenticator");
|
HWND handle=FindWindow(L"FLUTTER_RUNNER_WIN32_WINDOW", L"Yubico Authenticator");
|
||||||
WINDOWPLACEMENT place = { sizeof(WINDOWPLACEMENT) };
|
WINDOWPLACEMENT place = { sizeof(WINDOWPLACEMENT) };
|
||||||
GetWindowPlacement(handle, &place);
|
GetWindowPlacement(handle, &place);
|
||||||
switch(place.showCmd) {
|
switch(place.showCmd) {
|
||||||
|
Loading…
Reference in New Issue
Block a user