码迷,mamicode.com
首页 > Windows程序 > 详细

保持窗口始终显示在屏幕(即便Win+D返回桌面)

时间:2018-12-14 19:30:30      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:point   and   set   ati   send   poi   windows   zed   color   

解决方案:(其中 TopMost = true 便可使窗口保持最前端)

public mainFormHandler()
{
    InitializeComponent();
    // set TopMost
    this.TopMost = true;
}

private void mainFormHandler_SizeChanged(object sender, EventArgs e)
{
    if (this.WindowState == FormWindowState.Minimized)
    {
        this.WindowState = FormWindowState.Normal;
    }
    SetParent(this.Handle.ToInt32(), this.Handle.ToInt32());
}
[DllImport(
"user32.dll", EntryPoint = "SetParent")] public static extern int SetParent(int hWndChild, int hWndNewParent);

保持窗口始终显示在屏幕(即便Win+D返回桌面)

标签:point   and   set   ati   send   poi   windows   zed   color   

原文地址:https://www.cnblogs.com/jizhiqiliao/p/10120472.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!