0

What happens if an application is run via Task Manager on a Windows Server? I have a program that is created as Winform application. I want the application to run a process that normally is started by a user clicking a button.

If I set the Task manager to send a parameter to the Winform. Is there a way to have the application read that parameter and run a function without the window opening, but run the function? If so, what event should I put the code in?

edit: The question I should be asking is, is it possible to run a winform application where the form is not showing? Basically, launch an application, run some functions in the background, and not show the any forms, like a console application. The reason i don't want to create a console application is because I also need the winform for other purposes.

Peter Sun
  • 1,675
  • 4
  • 27
  • 50
  • Does this answer your question? [How do I pass command-line arguments to a WinForms application?](https://stackoverflow.com/questions/1179532/how-do-i-pass-command-line-arguments-to-a-winforms-application) – Charlieface Aug 19 '22 at 00:52
  • ee also https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/main-command-line Aside: this is nothing to do with Task Manager as such, you can do the same using a shortcut, or from command line, or from another application – Charlieface Aug 19 '22 at 00:53
  • This question is rather difficult to understand in its current format. You will have to edit it and add more information (screen shots, hand drawings for instance) to explain clearly what you want to do. Statements like "an application is run via Task Manager" and "the application to run a process that normally is started by a user clicking a button" are especially hard to understand because a Windows professional (or book) never uses that kind of terms. Again, people are willing to help here, but make sure you allow them to know what you want. – Lex Li Aug 19 '22 at 01:06

0 Answers0