Getting the starting shortcut in c#

前端 未结 2 1821
慢半拍i
慢半拍i 2021-01-21 00:54

Lets say that I have an executable and when it is started I want to know how it\'s started. I.e. I would like to know if it is started with a shortcut or directly. With this:

相关标签:
2条回答
  • 2021-01-21 01:01

    This won't work in general, but if you are creating the shortcut, you could add a command line parameter to identify it.

    0 讨论(0)
  • 2021-01-21 01:06

    Your suspicions are correct, with the operating system hiding the mechanics from you.

    It is possible to get the process that started you, however. this won't help you differentiate whether you were started from a link in the start menu, vs. being doubled clicked on in the explorer window though.

    0 讨论(0)
提交回复
热议问题