mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-06-28 13:34:09 +08:00
解决窗体最小化之后其他窗体无法输入的问题
This commit is contained in:
parent
f8fd529b61
commit
cd0521c813
@ -1154,6 +1154,8 @@ BLENDFUNCTION blendFunction // alpha-blending function
|
|||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
public static extern bool SetFocus(IntPtr hWnd);
|
public static extern bool SetFocus(IntPtr hWnd);
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
|
public static extern IntPtr GetFocus();
|
||||||
|
[DllImport("user32.dll")]
|
||||||
public static extern bool SetParent(IntPtr hWnd, IntPtr hWndNewParent);
|
public static extern bool SetParent(IntPtr hWnd, IntPtr hWndNewParent);
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
public static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommand nCmdShow);
|
public static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommand nCmdShow);
|
||||||
|
@ -1505,6 +1505,10 @@ namespace CPF.Windows
|
|||||||
|
|
||||||
public void SetIMEPosition(Point point)
|
public void SetIMEPosition(Point point)
|
||||||
{
|
{
|
||||||
|
if (canActivate && GetFocus() != handle)
|
||||||
|
{
|
||||||
|
SetFocus(handle);
|
||||||
|
}
|
||||||
COMPOSITIONFORM cf = new COMPOSITIONFORM();
|
COMPOSITIONFORM cf = new COMPOSITIONFORM();
|
||||||
cf.dwStyle = 2;
|
cf.dwStyle = 2;
|
||||||
cf.ptCurrentPos = new POINT((int)(point.X * scaling), (int)(point.Y * scaling));
|
cf.ptCurrentPos = new POINT((int)(point.X * scaling), (int)(point.Y * scaling));
|
||||||
|
Loading…
Reference in New Issue
Block a user