Question

Question:

What is the best way to show the tray icon, the window and the command line window and keep all of them responsive? The application should terminate when the command line window is closed.

Thanks for every second you spend on reading and probably answering :-)

And happy new year :-)

Background:

I am currently developing a small windows application. I'm using VS2012, C# and WPF. It gets the states of builds from continuous integration server and should do a reaction when a build fails.

My plan is to create a command line exe and windows service exe. Both should create a system tray icon in the task bar. With a click on the tray icon or in a context menu a WPF window should start (for configuration of server connection). I have three assemblies for this, a cmd.exe, a service.exe and shared-logic-and-ui.dll (names changed).

I created all single parts but have now a problem to mix it. Everything I tried leads to DeadLocks, frozen windows, app crashes... I'm inexperienced with multithreading...

Était-ce utile?

La solution

My solution: I remove the console application and the windows service. I create only the WPF application, but hide the window at start and only show the system tray icon. For startup at logon, I add the application the startup found in msiconfig.

But anyway: It would be possible to create a UI process from a windows service. See next links.

Question on Stackoverflow: Show a windows form from a windows service

Accepted answer on codeproject

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top