Delphi-PRAXiS
Seite 2 von 3     12 3      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi HKEY_CURRENT_USER für alle Benutzer anzeigen (https://www.delphipraxis.net/7395-hkey_current_user-fuer-alle-benutzer-anzeigen.html)

Assarbad 11. Aug 2003 16:21

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Dazu gibt es die GP (Group Policy) ... ergo: Kein guter Admin (oder Anfaenger ;))

alcaeus 11. Aug 2003 16:30

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
1. Nicht anfänger, sondern blutiger anfänger
2. es sind userabhängige parameter anzuhängen...

Assarbad 11. Aug 2003 17:16

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Wozu gibt es Variablen? ZB %Username% etc pp? Oder arbeitest du auf NT 3.51?

Erklaer mal exakt was du machen willst (mit Beispielen fuer mehrere User!!!) ... kannst die Daten ruhig tuerken, nur damit man nen Ueberblick bekommt.

@Mods: Vielleicht solltet ihr das hier abspalten oder gar ganz verschieben :)

alcaeus 11. Aug 2003 23:13

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Naja,in diesem Fall braucht es keine spezifischen Parameter, aber es kann sein dass sich ein Benutzer dieses Programm konfigurieren will (anzeigen, minimiert), und ich erledige dies lieber über Parameter, da ich dann nicht INI-Dateien suchen muss und alles einfacher "probieren" kann. Trotzdem,weiß jemand wie LoopupAccountName() funktioniert??? Danke schon mal

Assarbad 11. Aug 2003 23:15

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Ich habe dir oben ein Beispiel genannt: LoggedOn2!

alcaeus 11. Aug 2003 23:27

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Tja,ich hab mir mal das Prog runtergezogen, und leider muss ich sagen dass es nicht dass war was ich suchte...ich muss nicht wissen we an welchem PC angemeldet ist, sondern ich möchte eben mit LookupAccountName() die SID herausfinden um danach auf die einzelne Registry zu kommen...

Assarbad 11. Aug 2003 23:39

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
LookupAccountSid() und LookupAccountName() arbeiten analog. Hier der Aufruf in LoggedOn2:

LookupAccountSid(Pchar(ServerName), sid, userName, userNameSize, domainName, domainNameSize, sidType)

Ein Blick ins PSDK sagt uns:

Zitat:

Zitat von Microsoft
LookupAccountName
The LookupAccountName function accepts the name of a system and an account as input. It retrieves a security identifier (SID) for the account and the name of the domain on which the account was found.

Code:
BOOL LookupAccountName(
  LPCTSTR lpSystemName,
  LPCTSTR lpAccountName,
  PSID Sid,
  LPDWORD cbSid,
  LPTSTR ReferencedDomainName,
  LPDWORD cchReferencedDomainName,
  PSID_NAME_USE peUse
);
Parameters
lpSystemName
[in] Pointer to a null-terminated string that specifies the system. This string can be the name of a remote computer. If this string is NULL, the account name is retrieved on the local system.
lpAccountName
[in] Pointer to a null-terminated string that specifies the account name.
Use a fully qualified string in the domain\username format to ensure that LookupAccountName finds the account in the desired domain.

Sid
[out] Pointer to a buffer that receives the SID structure that corresponds to the account name pointed to by the lpAccountName parameter. If this parameter is NULL, cbSid must be zero.
cbSid
[in, out] Pointer to a variable. On input, this value specifies the size, in bytes, of the Sid buffer. If the function fails because the buffer is too small or if cbSid is zero, this variable receives the required buffer size.
ReferencedDomainName
[out] Pointer to a buffer that receives the name of the domain where the account name is found. For computers that are not joined to a domain, this buffer receives the computer name. If this parameter is NULL, the function returns the required buffer size.
cchReferencedDomainName
[in, out] Pointer to a variable. On input, this value specifies the size, in TCHARs, of the ReferencedDomainName buffer. If the function fails because the buffer is too small, this variable receives the required buffer size, including the terminating null character. If the ReferencedDomainName parameter is NULL, this parameter must be zero.
peUse
[out] Pointer to a SID_NAME_USE enumerated type that indicates the type of the account when the function returns.


alcaeus 11. Aug 2003 23:44

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Tja,ich hab mir mal das Prog runtergezogen, und leider muss ich sagen dass es nicht dass war was ich suchte...ich muss nicht wissen we an welchem PC angemeldet ist, sondern ich möchte eben mit LookupAccountName() die SID herausfinden um danach auf die einzelne Registry zu kommen...

Assarbad 12. Aug 2003 00:35

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Werde ich veraeppelt? 2mal der gleiche Text ohne auf meinen Post zu reagieren?

alcaeus 12. Aug 2003 07:57

Re: HKEY_CURRENT_USER für alle Benutzer anzeigen
 
Sorry Assarbad, aber es gab ein bisschen Konfusion wegen Post da/nicht da. Ich hab die gleiche Dokumentation für den Befehl gefunden, und ich verwende ihn auch ganz gleich, doch leider bekomme ich immer eine AccessViolation...


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:12 Uhr.
Seite 2 von 3     12 3      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz