getprocesswindowstation (user32)
Last changed: jachymko-213.199.128.148

.
Summary

C# Signature:

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
    [DllImport("user32", CharSet = CharSet.Unicode, SetLastError = true)]
    public static extern SafeWindowStationHandle GetProcessWindowStation();

User-Defined Types:

public sealed class SafeWindowStationHandle : SafeHandleZeroOrMinusOneIsInvalid
{
    public SafeWindowStationHandle()
        : base(true)
    {
    }

    protected override bool ReleaseHandle()
    {
        return SafeNativeMethods.CloseWindowStation(handle);
    }
}

Notes:

Quote from MSDN: "The CloseWindowStation function closes an open window station handle. Do not specify the handle returned by the GetProcessWindowStation function."

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation