-1

I am new in winform application. this there a way to find application is open from desktop shortcut icon.

baj9032
  • 2,414
  • 3
  • 22
  • 40

1 Answers1

3

You could put an argument in the shortcut:

enter image description here

and check for it in your application via its Environment.CommandLine:

enter image description here

But other than that, no. You won't be able to tell whether someone directly clicked on the executable or even if someone deleted the argument in the shortcut.

rory.ap
  • 34,009
  • 10
  • 83
  • 174