Tk Source Code

Artifact [b90253ec]
Login

Artifact b90253ecafd450d029b67004bfadcc38b9c90bbb:

Attachment "tkWinX.c.patch" to ticket [1374119f] added by pajas 2005-12-07 01:59:47.
--- win/tkWinX.c.orig	2005-12-06 09:57:05.000000000 +0100
+++ win/tkWinX.c	2005-12-06 09:59:37.000000000 +0100
@@ -245,6 +245,8 @@
     HINSTANCE hInstance)
 {
     INITCOMMONCONTROLSEX comctl;
+    CHARSETINFO lpCs;
+    DWORD lpCP;
 
     if (childClassInitialized != 0) {
 	return;
@@ -298,6 +300,17 @@
     }
 
     /*
+     * Initialize input language info
+     */
+    if(GetLocaleInfo(LANGIDFROMLCID(GetKeyboardLayout(0)),
+		     LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
+		     (LPWSTR) &lpCP,sizeof(lpCP)/sizeof(TCHAR))==0)
+	return CP_ACP;
+    if (TranslateCharsetInfo((DWORD *)lpCP, &lpCs, TCI_SRCCODEPAGE)==0)
+	return CP_ACP;
+    UpdateInputLanguage(lpCs.ciCharset);
+
+    /*
      * Make sure we cleanup on finalize.
      */