home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 April / Chip_2002-04_cd1.bin / zkuste / delphi / kolekce / d56 / NT.ZIP / NTDelGlobalGroup.pas < prev    next >
Pascal/Delphi Source File  |  1999-06-20  |  1KB  |  45 lines

  1. unit NTDelGlobalGroup;
  2.  
  3. interface
  4.  
  5. uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
  6.  
  7. type
  8.   TNTDelGlobalGroup = class(TComponent)
  9.   private
  10.     { Private declarations }
  11.     FServer:String;
  12.     FGroup:String;
  13.   protected
  14.     { Protected declarations }
  15.   public
  16.     { Public declarations }
  17.   published
  18.     { Published declarations }
  19.     property Server:String read FServer write FServer;
  20.     property Group:String read FGroup write FGroup;
  21.     function Execute:LongInt;
  22.   end;
  23.  
  24. function NetGroupDel(Server:PWideChar;GroupName:PWideChar):LongInt; stdcall; external 'netapi32.dll';
  25.  
  26. procedure Register;
  27.  
  28. implementation
  29.  
  30. function TNTDelGlobalGroup.Execute:LongInt;
  31. var tServer:Array[0..255] Of WideChar;
  32.     tGroup:Array[0..255] Of WideChar;
  33. begin
  34.      StringToWideChar(FServer,@tServer,255);
  35.      StringToWideChar(FGroup,@tGroup,255);
  36.      Result:=NetGroupDel(@tServer,@tGroup);
  37. end;
  38.  
  39. procedure Register;
  40. begin
  41.   RegisterComponents('NT Tools - Global', [TNTDelGlobalGroup]);
  42. end;
  43.  
  44. end.
  45.