From 2fbacdf140469925e987499703a1a3879232b9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=9A=93?= <353374337@qq.com> Date: Wed, 26 Dec 2018 17:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=83=E6=83=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HaoYue.BF3ChineseInput/MainWindow.xaml.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/HaoYue.BF3ChineseInput/MainWindow.xaml.cs b/HaoYue.BF3ChineseInput/MainWindow.xaml.cs index 9b059ba..1db0764 100644 --- a/HaoYue.BF3ChineseInput/MainWindow.xaml.cs +++ b/HaoYue.BF3ChineseInput/MainWindow.xaml.cs @@ -52,11 +52,12 @@ namespace HaoYue.BF3ChineseInput public static extern IntPtr GetF(); //获得本窗体的句柄 [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetForegroundWindow")] public static extern bool SetF(IntPtr hWnd); //设置此窗体为活动窗体 - private void timer1_Tick(object sender, EventArgs e) - { - if (this.Handle != GetF()) //如果本窗口没有获得焦点 - SetF(this.Handle); //设置本窗口获得焦点 - } + + //private void timer1_Tick(object sender, EventArgs e) + //{ + // if (this.Handle != GetF()) //如果本窗口没有获得焦点 + // SetF(this.Handle); //设置本窗口获得焦点 + //} private void hook_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) {