home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 April
/
Chip_2002-04_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
NT.ZIP
/
NTGlobalSetInfo.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-06-20
|
2KB
|
66 lines
unit NTGlobalSetInfo;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TNTGlobalSetInfo = class(TComponent)
private
{ Private declarations }
FServer:String;
FGroupName:String;
FName:String;
FComment:String;
FGroupID:DWORD;
FAttr:DWORD;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Server:String read FServer write FServer;
property GroupName:String read FGroupName write FGroupName;
property Name:String read FName write FName;
property Comment:String read FComment write FComment;
property GroupID:DWORD read FGroupID write FGroupID default 0;
property Attributes:DWORD read FAttr write FAttr default 0;
function Execute:LongInt;
end;
Type GROUP_INFO_2=record
grpi2_name:LPWSTR; grpi2_comment:LPWSTR; grpi2_group_id:DWORD; grpi2_attributes:DWORD;End;
function NetGroupSetInfo(Server:PWideChar;GroupName:PWideChar;Level:DWORD;Buf:PChar;ParmError:LPDWORD):LongInt; stdcall; external 'netapi32.dll';
procedure Register;
implementation
function TNTGlobalSetInfo.Execute:LongInt;
var
tServer:Array[0..255] Of WideChar;
tGroup:Array[0..255] Of WideChar;
tName:Array[0..255] Of WideChar;
tComment:Array[0..255] Of WideChar;
MyInfo:GROUP_INFO_2;
begin
StringToWideChar(FServer,@tServer,255);
StringToWideChar(FGroupName,@tGroup,255);
StringToWideChar(FName,@tName,255);
StringToWideChar(FComment,@tComment,255);
MyInfo.grpi2_name:=@tName;
MyInfo.grpi2_comment:=@tComment;
MyInfo.grpi2_group_id:=FGroupID;
MyInfo.grpi2_attributes:=FAttr;
Result:=NetGroupSetInfo(@tServer,@tGroup,2,@MyInfo,nil);
end;
procedure Register;
begin
RegisterComponents('NT Tools - Global', [TNTGlobalSetInfo]);
end;
end.