gpt4 book ai didi

winforms - 启动进程 TopMost

转载 作者:行者123 更新时间:2023-12-02 05:14:15 25 4
gpt4 key购买 nike

我有一个 C# .Net 2.0 应用程序,它实现了这样的全屏模式:

targetForm.WindowState = FormWindowState.Maximized;
targetForm.FormBorderStyle = FormBorderStyle.None;
targetForm.TopMost = true;
WinApi.SetWinFullScreen(targetForm.Handle); // let me know if you need the code of this methode

如果用户处于全屏模式并尝试打开帮助,则没有任何反应(对用户可见),HelpWindow 会显示在我的全屏窗体后面。帮助文件像这样打开:

string helpPath= Registry.CurrentUser.OpenSubKey(@"Software\...").GetValue("HelpFile") as string;
System.Diagnostics.Process.Start(helpPath); // the helpfile is a *.chm file

是否可以启动一个Process TopMost 或将其置于调用表单之前?如果是这样,怎么做到的?

最佳答案

我一直在使用以下代码将当前窗口置于顶部:

    [DllImport("user32")]
static extern int BringWindowToTop(int hwnd);

BringWindowToTop(this.Handle.ToInt32());

关于winforms - 启动进程 TopMost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2317025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com