如何用隐藏的主窗体启动Delphi应用程序? [英] How can I start Delphi application with the hidden main form?

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

问题描述

我在Delphi中使用以下主窗体初始化的应用程序:

  Application.CreateForm(< class> ;变量>); 

它显示应用程序启动时的主窗体。



如何使用隐藏的主窗体(或非视觉模式)启动Delphi应用程序?

解决方案

在项目源文件集中

  Application.ShowMainForm:= false; 

在主窗体创建之前:

  Application.CreateForm(TMainForm,MainForm); 

从Remy更新:



您可以也将其设置在MainForm的OnCreate事件中。要求是在Application.Run()被调用之前设置ShowMainForm。


I have the application on Delphi with the following main form initialization:

Application.CreateForm(<class>, <variable>);

It shows the main form when the application starts.

How can I start Delphi application with the hidden main form (or on non-visual mode at all)?

解决方案

In project source file set

Application.ShowMainForm := false;

just before main form creation :

Application.CreateForm(TMainForm, MainForm);

Update from Remy:

You can also set it in the MainForm's OnCreate event. The requirement is to set ShowMainForm before Application.Run() is called.

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

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