diff options
Diffstat (limited to 'src/ExpandVolume/WinMain.cpp')
-rw-r--r-- | src/ExpandVolume/WinMain.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp index 9a822153..37cd11c8 100644 --- a/src/ExpandVolume/WinMain.cpp +++ b/src/ExpandVolume/WinMain.cpp @@ -133,3 +133,3 @@ KeyFile *FirstCmdKeyFile; HBITMAP hbmLogoBitmapRescaled = NULL; -wchar_t OrigKeyboardLayout [8+1] = L"00000409"; +wchar_t OrigKeyboardLayout [KL_NAMELENGTH] = L"00000409"; BOOL bKeyboardLayoutChanged = FALSE; /* TRUE if the keyboard layout was changed to the standard US keyboard layout (from any other layout). */ @@ -554,5 +554,8 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA - StringCbPrintfW (OrigKeyboardLayout, sizeof(OrigKeyboardLayout),L"%08X", (DWORD) GetKeyboardLayout (NULL) & 0xFFFF); + if (!GetKeyboardLayoutNameW(OrigKeyboardLayout)) + { + StringCbPrintfW(OrigKeyboardLayout, sizeof(OrigKeyboardLayout), L"%08X", (DWORD) (DWORD_PTR) GetKeyboardLayout(NULL) & 0xFFFF); + } - DWORD keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE); + DWORD keybLayout = (DWORD) (DWORD_PTR) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE); @@ -596,3 +599,3 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA { - DWORD keybLayout = (DWORD) GetKeyboardLayout (NULL); + DWORD keybLayout = (DWORD) (DWORD_PTR) GetKeyboardLayout (NULL); @@ -609,3 +612,3 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA - keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE); + keybLayout = (DWORD) (DWORD_PTR) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE); |