有什么方法可以检测并覆盖 Windows 快捷方式参数运行最小化吗? 我想检测快捷方式是否想要最小化启动程序,然后自己处理最小化/最大化/正常大小。
我有一个使用它创建的启动屏幕
Form_Splash := TForm_Splash.Create(Application);
我稍后使用创建主表单
Application.CreateForm(TForm_main, Form_main);
显示主窗体后,我销毁 form_Splash,此时我想根据 Windows 快捷方式请求的内容最小化/最大化/正常大小 form_main。
感谢您的帮助。 史蒂夫...
最佳答案
您可以使用GetStartupInfo
API调用获取STARTUPINFO
在创建时传递给您的进程(Delphi 中的TStartupInfo
)。 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.
所以对于任何窗口 ShowWindow
首次调用时,将使用启动信息记录中指定的值。这可能会影响您的启动屏幕。
但无论如何 - 您可以使用 STARTUPINFO
中的值让您的主表单相应地执行操作。
就我个人而言,当我希望应用程序最小化启动时,我会讨厌向我显示启动屏幕的应用程序。通常这些应用程序还会窃取我的输入焦点,这让我发疯。
关于delphi - 以最小化应用程序启动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7071017/