C# WINFORM 强制让窗体获得焦点的方法代码
代码如下://调用API [System.Runtime.InteropServices.DllImport(“user32.dll”, CharSet = System.Runtime.InteropServices.CharSet.Auto, ExactSpelling = true)] public static extern IntPtr GetForegroundWindow(); //获得本窗体的句柄 [System.Runtime.InteropServices.DllImport(“user32.dll”, EntryPoint = “SetForegroundWindow”)
用户评论