隐藏Delphi 2009应用程序中的主窗体 [英] Hide the Main Form in a Delphi 2009 Application

查看:183
本文介绍了隐藏Delphi 2009应用程序中的主窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码在Delphi 7中正常工作。但是,在Delphi 2009中,表单确实保持隐藏,但任务栏上的按钮现在正在出现。

The following code works fine in Delphi 7. However, in Delphi 2009 the form does remain hidden but the button on the taskbar is now appearing.

ShowWindow(Handle, SW_HIDE);
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW );
ShowWindow(Handle, SW_SHOW);

以上代码在FormCreate方法中调用。

The above code is called in the FormCreate method.

推荐答案

说明我们在任务栏上看到应用程序窗口的原因是一个类似于stukelly的答案但不完全的简单设置。

Turns out the reason we were seeing the Application window on the taskbar was a simple setting similar to stukelly's answer but not quite.

要使主窗体出现在任务栏上并隐藏您应用的应用程序菜单:

To get the main form to appear on the task bar and hide the application menu you apply:

Application.MainFormOnTaskbar := True;
Application.ShowMainForm := False;

表单后面没有代码创建或任何需要。

No code behind the form create or anything required.

这篇关于隐藏Delphi 2009应用程序中的主窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆