[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
const int SW_SHOW =5;
string Tartgetfile = @"C:\BringLog.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.FileName = Tartgetfile;
try
{
if (p.Start() == true)
{
ShowWindow(p.Handle, SW_SHOW);
WriteToLog("PROCESS STARTED");
}
else
{
WriteToLog("FAILED TO START PROCESS");
}
}
catch (Exception ex)
{
WriteToLog("FAILED TO START PROCESS" + ex.Message+ ex.Source);
}
i have used this code in my service onsessionchange event, the service start my application on logon event but application is hidden but running. i couldn't view