Skip to content

Support WindowStyle without UseShellExecute in ProcessStartInfo and Process implementation on Windows #81681

@iSazonov

Description

@iSazonov

In PowerShell repository we have to use pinvoke to support WindowStyle without UseShellExecute.

Today .Net supports WindowStyle only if UseShellExecute is true

private bool StartCore(ProcessStartInfo startInfo)
{
return startInfo.UseShellExecute
? StartWithShellExecuteEx(startInfo)
: StartWithCreateProcess(startInfo);
}
private unsafe bool StartWithShellExecuteEx(ProcessStartInfo startInfo)

Current request is to add support for WindowStyle (on Windows) if UseShellExecute is false

private unsafe bool StartWithCreateProcess(ProcessStartInfo startInfo)

It looks like a very simple implementation.
We would like confirmation soon from the .Net team that this can be implemented in .Net 8 so that we can avoid unnecessary work in the PowerShell repository.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions