[WinAPI]如何检测通过单击或自动启动启动的应用程序? [英] [WinAPI] How to detect the application started by click or autostart?

查看:161
本文介绍了[WinAPI]如何检测通过单击或自动启动启动的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我有一个应用程序,该应用程序将在每次Windows启动(自动启动)时运行.我希望如果应用程序自动启动,它将被隐藏SW_HIDE,如果应用程序由用户单击其图标启动,它将显示(SW_SHOW)
那么,如何检测应用程序是通过单击还是通过自动启动来启动?

谢谢!

Dear all,

I have an application and this application will run every Windows start (autostart). I want that if application autostart, it will be hidden SW_HIDE and if application start by user click on its icon, it will show (SW_SHOW)
So, How to detect if the applicaion start by click or autostart?

Thank you!

推荐答案

一个简单的解决方案是在自动启动应用程序时简单地使用命令行参数.在注册表windows \ currentversion \ run中,您只需将其添加到命令中,例如:``... \ application.exe/hide",然后在找到"/hide"时将窗口的样式设置为SW_HIDE).在args中.顺便说一下,这就是大多数应用程序执行此操作的方式.

祝你好运!
An easy solution is to simply use an command line parameter when you autostart the application. In the registry windows\currentversion\run you just add it to the command, something like: ''...\application.exe /hide'' and set the style of your window to SW_HIDE) when you find ''/hide'' in args. This is how most applications do this by the way.

Good luck!


这篇关于[WinAPI]如何检测通过单击或自动启动启动的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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