locked
modify C# 2008 desktop application RRS feed

  • Question

  • In an existing C# 2008 windows application I am trying to decide how to  use the existing application without rewriting it. Currently there is a 'driver C# 2008 windows' program that calls the 'main C# 2008 desktop' application to perform various caLLS to a third parfty web service.

     Now I would like to use the 'main C# 2008 desktop' application to be run by users. The users would enter the required paramters in a desktop screen and/or possibly a dos popup window. The application would know who is running the program by the paramters that are passed to the application.

    Thus my question is, can a desktop screen and/or a dos popup window show up when users click on the executable? The default would be for the no desktop window to show up when the program is called by the 'driver C# 2008 windows' program.

    Thus can you show me code and/or point me to urls that would show me how to accomplish this goal? If my goal not realistic, can you suggest other ways that I can accomplish the add on goal I am trying to acheive?

    Thursday, May 2, 2013 2:45 AM

Answers

  • You could accomplish this behavior by passing an argument to the executable and checking for it in the "main C# 2008 desktop" application. Say the "main C# 2008 desktop" application was called MainDesktop.exe, you could execute it as "MainDesktop.exe /nogui" when using the driver application and execute it as "MainDestop.exe" without the argument when you want the users to specify the parameters.

    Alternatively, you could use windows security to check to see which user is executing the code and check for the account that the driver application is using to determine if you want to show the GUI or not.

    Thursday, May 2, 2013 5:10 AM

All replies

  • You could accomplish this behavior by passing an argument to the executable and checking for it in the "main C# 2008 desktop" application. Say the "main C# 2008 desktop" application was called MainDesktop.exe, you could execute it as "MainDesktop.exe /nogui" when using the driver application and execute it as "MainDestop.exe" without the argument when you want the users to specify the parameters.

    Alternatively, you could use windows security to check to see which user is executing the code and check for the account that the driver application is using to determine if you want to show the GUI or not.

    Thursday, May 2, 2013 5:10 AM
  • Wendy,

    You are describing the problem like an end user. Do you have the sources and the full rights about the use of that?

    Be aware that encapsulating non owned programs in other programs can be malicious.

    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/dd4c2e57-ba8b-476c-8f39-38bf623e64ff


    Success
    Cor

    Thursday, May 2, 2013 7:38 AM