TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
lagerg
NA
9
0
Having a Problem starting an Application from a Service
Sep 26 2003 1:31 PM
I have used this code successfully in a form application. I tried to add the same code in a service and have not been able to get the application to start. I have the service starting with a local account and the Interact with the Desktop is Checked. Windows media player seems to start but then closes almost immediately. I would appreciate any help. Thanks, Glenn private void InitializeComponent() { this.p = new System.Diagnostics.Process(); this.p.EnableRaisingEvents = true; this.p.StartInfo.FileName = "C:\\Program Files\\Windows Media Player\\wmplayer.exe"; this.p.StartInfo.RedirectStandardError = true; this.p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized; this.p.StartInfo.UseShellExecute = true; this.p.SynchronizingObject = this; this.p.Exited += new System.EventHandler(this.p_Exited); // Manager // this.ServiceName = "Manager"; ((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit(); }// end of InitializeComponent private void p_Exited(object sender, System.EventArgs e) { try { p.Start(); } catch(Exception e1) { MessageBox.Show(e1.Message.ToString(),"Error",MessageBoxButtons.OK,MessageBoxIcon.Error); } }// end of p_Exited public void Startup() { p.Start(); }
Reply
Answers (
2
)
Some design chit-chat.
MenuItem's method called FindMenuItem.