25 Apr

Detecting Windows boot-up state using GetSystemMetrics function

Using GetSystemMetrics function, we can detect how the system is started.

function WindowsStartUpState: string;
begin
  case (GetSystemMetrics(SM_CLEANBOOT)) of
    0: Result := 'Normal boot';
    1: Result := 'Fail-safe boot';
    2: Result := 'Fail-safe with network boot';
  else
    Result := 'Unknown state';
  end;
end;
  • Digg
  • del.icio.us
  • Facebook
  • Twitter
  • Technorati
  • Google Bookmarks
  • Live
  • LinkedIn
  • MySpace

Leave a Reply

You must be logged in to post a comment.