public static string GetErrorMsg(uint id) { char[] buf = new char[256]; if (Win32Import.FormatMessage( Win32Import.FormatMessage_Flag.FromSystem, null, id, 0, buf, buf.Length, IntPtr.Zero) > 0) return new string(buf); return string.Empty; }