2

My problem is about starting a process from windows service. I succeed opening process with below method.

    [DllImport("advapi32.dll", EntryPoint = "CreateProcessAsUser", SetLastError = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
private static extern bool CreateProcessAsUser(
    IntPtr hToken,
    String lpApplicationName,
    String lpCommandLine,
    IntPtr lpProcessAttributes,
    IntPtr lpThreadAttributes,
    bool bInheritHandle,
    uint dwCreationFlags,
    IntPtr lpEnvironment,
    String lpCurrentDirectory,
    STARTUPINFO lpStartupInfo,
    out PROCESS_INFORMATION lpProcessInformation);

But it opens process in minimized style. With STARTUPINFO.showWindow parameter, it must be fixed but nothing happens.

Many thanks..

Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92
dilan
  • 21
  • 4

0 Answers0