From: newton-cn Date: Thu, 29 Jan 2026 07:58:49 +0000 (+0900) Subject: dddd X-Git-Url: https://git.insang.kr/gitweb/?a=commitdiff_plain;h=30a623031507ea3cf852079dbf873692d18b1b5a;p=newton-cn_pos.git dddd --- diff --git a/.vs/newton-cn/v16/.suo b/.vs/newton-cn/v16/.suo index 3e294be..74574db 100644 Binary files a/.vs/newton-cn/v16/.suo and b/.vs/newton-cn/v16/.suo differ diff --git a/newton-cn/Form1.cs b/newton-cn/Form1.cs index 400182d..b35809b 100644 --- a/newton-cn/Form1.cs +++ b/newton-cn/Form1.cs @@ -31,7 +31,10 @@ namespace newton_cn } private void Form1_Load(object sender, EventArgs e) { - + foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages) + { + Debug.WriteLine(lang.Culture.Name + " / " + lang.LayoutName); + } } private void button1_Click_1(object sender, EventArgs e) diff --git a/newton-cn/Form9.cs b/newton-cn/Form9.cs index ef5c62d..9bc6e13 100644 --- a/newton-cn/Form9.cs +++ b/newton-cn/Form9.cs @@ -14,6 +14,24 @@ namespace newton_cn { public partial class Form9 : Form { + class ImeHelper + { + [DllImport("user32.dll")] + private static extern IntPtr GetKeyboardLayout(uint idThread); + + [DllImport("user32.dll")] + private static extern IntPtr LoadKeyboardLayout(string pwszKLID, uint Flags); + + [DllImport("user32.dll")] + private static extern int ActivateKeyboardLayout(IntPtr hkl, uint Flags); + + public static void SwitchToEnglish() + { + // 0x409 = en-US + IntPtr hkl = LoadKeyboardLayout("00000409", 1); + ActivateKeyboardLayout(hkl, 0); + } + } [DllImport("user32.dll")] @@ -142,23 +160,14 @@ namespace newton_cn th.Start();*/ Application.OpenForms["Form9"].Close(); - - // 1️⃣ 현재 입력 언어 저장 - InputLanguage originalLanguage = InputLanguage.CurrentInputLanguage; - - // 2️⃣ 영어 입력 언어 찾기 - InputLanguage english = InputLanguage.InstalledInputLanguages - .Cast() - .FirstOrDefault(lang => lang.Culture.Name.StartsWith("en")); - string phone = textBox1.Text; MouseEvent1 me = new MouseEvent1(); me.ctclick(); // 키보드 입력처럼 전송 Thread.Sleep(2000); - InputLanguage.CurrentInputLanguage = english; + ImeHelper.SwitchToEnglish(); SendKeys.SendWait("a' or ct_code='" + phone + "' or 1 like 'a"); - InputLanguage.CurrentInputLanguage = originalLanguage; + SendKeys.SendWait("{HANGUL}"); // 한/영 키 Thread.Sleep(1000); SendKeys.SendWait("{ENTER}"); Thread.Sleep(1000); diff --git a/newton-cn/bin/Debug/newton-cn.exe b/newton-cn/bin/Debug/newton-cn.exe index 73d58d0..712f537 100644 Binary files a/newton-cn/bin/Debug/newton-cn.exe and b/newton-cn/bin/Debug/newton-cn.exe differ diff --git a/newton-cn/bin/Debug/newton-cn.pdb b/newton-cn/bin/Debug/newton-cn.pdb index d353c94..2e519fc 100644 Binary files a/newton-cn/bin/Debug/newton-cn.pdb and b/newton-cn/bin/Debug/newton-cn.pdb differ diff --git a/newton-cn/bin/Release/newton-cn.exe b/newton-cn/bin/Release/newton-cn.exe index 31b629d..23947e9 100644 Binary files a/newton-cn/bin/Release/newton-cn.exe and b/newton-cn/bin/Release/newton-cn.exe differ diff --git a/newton-cn/bin/Release/newton-cn.pdb b/newton-cn/bin/Release/newton-cn.pdb index 160e8b2..1395c6d 100644 Binary files a/newton-cn/bin/Release/newton-cn.pdb and b/newton-cn/bin/Release/newton-cn.pdb differ diff --git a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 64a02a6..4aa4474 100644 Binary files a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache b/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache index f5e894a..654fe63 100644 Binary files a/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache and b/newton-cn/obj/Debug/newton-cn.csproj.AssemblyReference.cache differ diff --git a/newton-cn/obj/Debug/newton-cn.exe b/newton-cn/obj/Debug/newton-cn.exe index 73d58d0..712f537 100644 Binary files a/newton-cn/obj/Debug/newton-cn.exe and b/newton-cn/obj/Debug/newton-cn.exe differ diff --git a/newton-cn/obj/Debug/newton-cn.pdb b/newton-cn/obj/Debug/newton-cn.pdb index d353c94..2e519fc 100644 Binary files a/newton-cn/obj/Debug/newton-cn.pdb and b/newton-cn/obj/Debug/newton-cn.pdb differ diff --git a/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache b/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache deleted file mode 100644 index 654fe63..0000000 Binary files a/newton-cn/obj/Release/newton-cn.csproj.AssemblyReference.cache and /dev/null differ diff --git a/newton-cn/obj/Release/newton-cn.csproj.FileListAbsolute.txt b/newton-cn/obj/Release/newton-cn.csproj.FileListAbsolute.txt index 7ef1806..e9b1a2e 100644 --- a/newton-cn/obj/Release/newton-cn.csproj.FileListAbsolute.txt +++ b/newton-cn/obj/Release/newton-cn.csproj.FileListAbsolute.txt @@ -37,4 +37,3 @@ z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn. z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form7.resources z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form8.resources z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton_cn.Form9.resources -z:\바탕 화면\insang\workspace\newton-cn_pos\newton-cn\obj\Release\newton-cn.csproj.AssemblyReference.cache diff --git a/newton-cn/obj/Release/newton-cn.exe b/newton-cn/obj/Release/newton-cn.exe index 31b629d..23947e9 100644 Binary files a/newton-cn/obj/Release/newton-cn.exe and b/newton-cn/obj/Release/newton-cn.exe differ diff --git a/newton-cn/obj/Release/newton-cn.pdb b/newton-cn/obj/Release/newton-cn.pdb index 160e8b2..1395c6d 100644 Binary files a/newton-cn/obj/Release/newton-cn.pdb and b/newton-cn/obj/Release/newton-cn.pdb differ