home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 April
/
Chip_2002-04_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
NT.ZIP
/
NTAddGlobalGroup.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-06-19
|
1KB
|
56 lines
unit NTAddGlobalGroup;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TNTAddGlobalGroup = class(TComponent)
private
{ Private declarations }
FServer:String;
FGroup:String;
FComment:String;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Server:String read FServer write FServer;
property Group:String read FGroup write FGroup;
property Comment:String read FComment write FComment;
function Execute:LongInt;
end;
Type GROUP_INFO_1=record
grpi1_name:LPWSTR; grpi1_comment:LPWSTR;End;
function NetGroupAdd(ServerName:PWideChar;Level:DWORD;Buf:PChar;ParmError:LPDWORD):LongInt; stdcall; external 'netapi32.dll';
procedure Register;
implementation
function TNTAddGlobalGroup.Execute:LongInt;
var
MyInfo:GROUP_INFO_1;
tComment:Array[0..255] Of WideChar;
tGroup:Array[0..255] Of WideChar;
tServer:Array[0..255] Of WideChar;
begin
StringToWideChar(FServer,@tServer,255);
StringToWideChar(FComment,@tComment,255);
StringToWideChar(FGroup,@tGroup,255);
MyInfo.grpi1_name:=@tGroup;
MyInfo.grpi1_comment:=@tComment;
Result:=NetGroupAdd(@tServer,1,@MyInfo,nil);
end;
procedure Register;
begin
RegisterComponents('NT Tools - Global', [TNTAddGlobalGroup]);
end;
end.