Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Suche API um Workgroup zu aendern (https://www.delphipraxis.net/82175-suche-api-um-workgroup-zu-aendern.html)

Mackhack 8. Dez 2006 02:40


Suche API um Workgroup zu aendern
 
Hi,

kennt jemand ne API um die Workgroup zu aendern (wenn moeglich ohne zu rebooten)?

Danke!

Christian Seehase 8. Dez 2006 03:52

Re: Suche API um Workgroup zu aendern
 
Moin Mackhack,

dazu dient MSDN-Library durchsuchenNetJoinDomain.
Die Funktion steht allerdings erst ab Windows 2000 zur Verfügung.
Unter NT 4.0 wird es richtig kompliziert.

Mackhack 8. Dez 2006 15:13

Re: Suche API um Workgroup zu aendern
 
Danke Christian,

hatte das per Suche auch schon gefunden gehabt war mir aber nicht sicher ob es das Richtige war!

Christian Seehase 8. Dez 2006 23:14

Re: Suche API um Workgroup zu aendern
 
Moin Mackhack,

und hier mal ein Beispiel:

Delphi-Quellcode:
type // aus lmcons.h
  NET_API_STATUS = type DWORD;

// aus lmjoin.h
function NetJoinDomain(
  const lpServer   : LPCWSTR;
  const lpDomain   : LPCWSTR;
  const lpAccountOU : LPCWSTR;
  const lpAccount  : LPCWSTR;
  const lpPassword : LPCWSTR;
  const fJoinOptions : DWORD
  ) : NET_API_STATUS; stdcall; external 'netapi32.dll';

const // aus lmerr.h
  NERR_Success             = 0;


var
  dwResult : DWORD;

begin
  dwResult := NetJoinDomain(nil,'ARBEITSGRUPPE',nil,nil,nil,0);
  if dwResult <> NERR_Success then begin
    ShowMessage(SysErrorMessage(dwResult));
  end else begin
    ShowMessage('Alles gut');
  end;
end;

Mackhack 8. Dez 2006 23:41

Re: Suche API um Workgroup zu aendern
 
Vielen Dank!

Hilft sehr!


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:00 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