Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
...
interface
...
type
NET_API_STATUS = DWORD;
SHARE_INFO_0 = record
shi0_netname : PWideChar;
end;
PSHARE_INFO_0 = ^SHARE_INFO_0;
function NetShareEnum(ServerName : PWideChar;
Level : DWORD;
bufptr : Pointer;
PrefMaxLen : DWORD;
EntriesRead : PDWORD;
TotalEntries : PDWORD;
Resume_Handle: PDWORD):NET_API_STATUS;
stdcall; external 'NetAPI32.dll' name 'NetShareEnum';
function NetApiBufferFree(Buffer: Pointer): NET_API_STATUS;
stdcall; external 'NetAPI32.dll' name 'NetApiBufferFree';
...
implementation
...
procedure TForm1.Button1Click(Sender: TObject);
const
MAX_PREFERRED_LENGTH = -1;
NERR_SUCCESS = 0;
var
ER : DWORD; // enries read
TE : DWORD; // total entries
ResHandle : DWORD;
ShareInfo : PSHARE_INFO_0;
p : pChar;
fResult : NET_API_STATUS;
i : Integer;
begin
ResHandle := 0;
fResult := NetShareEnum(nil, 0, @ShareInfo, DWORD(MAX_PREFERRED_LENGTH), @ER, @TE, @ResHandle);
if(fResult <> NERR_SUCCESS)then
Exit;
p := Pointer(ShareInfo);
for i := 0 to TE - 1 do
begin
ListBox1.Items.Add(WideCharToString(PSHARE_INFO_0(p)^.shi0_netname));
p := p + 4;
end;
NetApiBufferFree(@ShareInfo);
end;