AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

[Win2000] - Abmelden vom Dienst

Ein Thema von xZise · begonnen am 19. Dez 2007 · letzter Beitrag vom 2. Apr 2009
Antwort Antwort
Benutzerbild von xZise
xZise

Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
 
Delphi 2009 Professional
 
#1

Re: [Win2000] - Abmelden vom Dienst

  Alt 30. Mär 2009, 16:46
Hallo Dezipaitor,

Zitat:
An Exception of type EJwsclProcessIdNotAvailable was raised.
(Data was given by programmer and can vary from actual source.)
Source method....: Create
Source class.....: TJwImpersonation
Source file......: JwsclImpersonation.pas
Source line......: 0
GetLastError.....: 1400 ($578)
GetLastErrorMsg..: Ungültiges Fensterhandle

Message : The process "Progman1" (Id: 0x0) could not be found.
mit folgenden Code:
Delphi-Quellcode:
function ImpersonateAndExecute(const Flag : DWORD) : Boolean;
var
  Imp : IJwImpersonation;
  PrivScope : IJwPrivilegeScope;
begin
  Result := true;
  try
    //raises EJwsclProcessIdNotAvailable
    //EJwsclWinCallFailedException
    Imp := JwImpersonateLoggedOnUser;

    if TJwWindowsVersion.IsWindows2000(true) then
    begin
      //raises EJwsclPrivilegeException
      PrivScope := JwGetPrivilegeScope([SE_SHUTDOWN_NAME]);

      if not ExitWindowsEx(Flag, 0) then
        RaiseLastOSError;
    end else
      AddToLog('Not W2k+');
  except
    on e: Exception do
    begin
      AddToLog(e.Message);
// on e : EJwsclProcessIdNotAvailable do
      Result := false;
// on e : EJwsclWinCallFailedException do
      Result := false;
    end;
  end;
end;
MfG
xZise
Fabian
Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:10 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz