正在运行的应用程序如何知道启动该应用程序的桌面快捷方式的名称或其他信息? [英] How a running application can know the name or other info of the desktop-shortcut that started this application ?

查看:122
本文介绍了正在运行的应用程序如何知道启动该应用程序的桌面快捷方式的名称或其他信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.假设有10个桌面快捷方式,它们都具有不同的名称/图标,它们指向并可以从同一目录启动相同的exe应用程序.应用程序启动后,是否有任何方法可以知道或发现被doubled_clicked并启动了该应用程序的快捷方式的唯一名称?通常,运行中的应用程序是否还可以通过命令行,双击exe,双击指向该快捷方式的快捷方式或其他进程来启动它?谢谢.

Hello all. Let''s say 10 desktop shortcuts, all with different names/icons, point to and can start the same exe application from the same directory. Is there any means for the application, after it is started, to know or to discover the distinct name of the shortcut that was doubled_clicked and started this application? Also is there in general any means for a running application to know if it was started by command line, by a double_click on the exe, by a double_click on a shortcut that points to it, or by another process'' call ? Thank you.

推荐答案

感谢我的朋友Antonis Chatzipavlis,他是所有.NET技术和专家.非常感谢的平台,解决方案是这样的:在每个快捷方式中,使用command_line参数启动应用程序,例如"myapp.exe start_arg = 1",然后在form_load节中检查start_arg参数的值. .整洁的.感谢Antonis.约翰
Antonis建议使用以下链接:
CmdLineArgs [ devx.com文章 [ programmers-corner [读取命令行参数vb.net [ ^ ]
如何列出命令行参数 [进程开始vb.net [ CmdLine [使用命令行参数运行vb.net程序 [
Thanks to my friend, Antonis Chatzipavlis, an expert on all of the .NET technologies & platforms, whom I thank very much, the solution goes like this: In each shortcut, start the application with a command_line argument, for example "myapp.exe start_arg = 1" and then inside the form_load section check for the value of the start_arg argument. Neat. Thankzzz Antonis. John
Antonis suggests the following links:
CmdLineArgs[^]
devx.com Article[^]
programmers-corner[^]
reading command line arguments vb.net[^]
howto list command line arguments[^]
process start vb.net[^]
CmdLine[^]
running a vb.net program with command line arguments[^]


我可以在命令行上提供自己的工作;它非常易于使用,并且可以自动创建命令行,命令行处理和文档定义的过程:基于枚举的命令行实用程序 [ ^ ].它被CodeProject社区很好地接受.

我希望您理解C#中的事实没有区别:只要它们是不同的项目,C#和VB.NET程序集之间就不会有任何障碍.

—SA
I can offer my own work on Command Line; it''s very easy to use and higly automate the process of creation of definitions for command line, command line processing and documenting: Enumeration-based Command Line Utility[^]. It was very well accepted by CodeProject community.

I hope you understand that the fact it is in C# makes no difference: there is not any barriers between C# and VB.NET assemblies, as soon as they are the different projects.

—SA


这篇关于正在运行的应用程序如何知道启动该应用程序的桌面快捷方式的名称或其他信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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