以最小化的应用程序启动程序 [英] Start program with application minimized

查看:117
本文介绍了以最小化的应用程序启动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以检测然后覆盖Windows快捷方式参数运行最小化?
我想检测快捷方式是否要最小化启动程序,然后稍后再处理最小化/最大化/正常调整大小。

Is there any way to detect then override the Windows Shortcut param run Minimized? I want to detect if the shortcut is wanting to start the program minimized then handle the Minimize/maximize/normal sizing myself later.

我有一个启动画面我使用

I have a splash screen that I create using

Form_Splash := TForm_Splash.Create(Application);

我稍后会使用

Application.CreateForm(TForm_main, Form_main);

在显示主表单后,我销毁了form_Splash,当时我想最小化/最大化/正常大小,取决于Windows快捷方式的要求。

after the main form is displayed I destroy the form_Splash and at that time I want to minimize/maximize/normal size the form_main based on what the windows shortcut requested.

感谢您的帮助。
史蒂夫...

Thanks for any help. Steve...

推荐答案

您可以使用 GetStartupInfo API调用以获取< a href = http://msdn.microsoft.com/zh-cn/library/ms686331%28v=vs.85%29.aspx rel = nofollow> STARTUPINFO 传递给创建时的过程(在Delphi中为 TStartupInfo )。 wShowWindow 成员包含所需的初始显示状态。

You can use the GetStartupInfo API call to get the STARTUPINFO passed to your process on creation (TStartupInfo in Delphi). The wShowWindow member contains the desired initial show state.

总要知道的是:


对于GUI进程,首次调用ShowWindow时,将忽略其nCmdShow
参数wShowWindow指定默认值。在随后的对ShowWindow的
调用中,如果ShowWindow的
nCmdShow参数设置为SW_SHOWDEFAULT,则使用wShowWindow成员。

For GUI processes, the first time ShowWindow is called, its nCmdShow parameter is ignored wShowWindow specifies the default value. In subsequent calls to ShowWindow, the wShowWindow member is used if the nCmdShow parameter of ShowWindow is set to SW_SHOWDEFAULT.

因此对于任何窗口 <$ c $首先调用c> ShowWindow ,将使用启动信息记录中指定的值。这可能会影响您的启动屏幕。

So for whatever window ShowWindow is first called, the value specified in the startup info record will be used. This could affect your splash screen.

但是在任何情况下,您都可以使用 STARTUPINFO 中的值

But in any case - you can use the value from the STARTUPINFO to have your main form acting accordingly.

我个人讨厌当我希望启动它最小化时向我显示启动屏幕的应用程序。通常这些应用程序还会窃取我的输入焦点,这使我发疯。

Personally I would hate the application showing me the splash screen when I want it to start minimized. Usually these applications also steal my input focus which drives me mad.

这篇关于以最小化的应用程序启动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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