[DllImport("user32.dll", SetLastError = true)]
static extern bool LockWorkStation();
<DllImport("user32.dll", SetLastError:=True)> _
Public Shared Function LockWorkStation() As Boolean
End Function
None.
LockWorkStation uses LastError
void LockWorkStationSafe()
{
bool result = LockWorkStation();
if( result == false )
{
// An error occured
throw new Win32Exception( Marshal.GetLastWin32Error() );
}
}
Do you know one? Please contribute it!