i created new windows service with timer inside it for scheduler purpose and it can run successfully but it can't run other application (ex: notepad) when the timer elapsed..
i can see the process running in Task Manager but the notepad windows is not open
i used this code in timer_elapsed event
where applauncher is a ClassCode:AppLauncher oAppLauncher = new AppLauncher(@"C:\Windows\Regedit.exe"); new Thread(new ThreadStart(oAppLauncher.StartProcess)).Start();
when i build windows App i can see Notepad open using the same codeCode:class AppLauncher { string myAppPath = string.Empty; public AppLauncher(string _sPath) { myAppPath = _sPath; } public void StartProcess() { ProcessStartInfo oProcessStartInfo = new ProcessStartInfo(myAppPath); oProcessStartInfo.WindowStyle = ProcessWindowStyle.Maximized; Process oProcess = Process.Start(oProcessStartInfo); } }
any insight?
thanks




Reply With Quote