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
....
function CreateOrOpenMemShare():Boolean;
...
var
hMappedFile : Cardinal = 0;
MappingExists : Boolean = False;
SharedObject : TMyObject = nil;
implementation
function CreateOrOpenMemShare():Boolean;
var
NewlyCreated : Boolean;
begin
Result := False;
hMappedFile := CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, SizeOf(TMyObject), pChar('MemShareName'));
if (hMappedFile <> 0) then
begin
NewlyCreated := (GetLastError <> ERROR_ALREADY_EXISTS);
SharedObject := MapViewOfFile(hMappedFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);
Result := Assigned(SharedObject);
MappingExists := Result;
if (Result and NewlyCreated) then
SharedObject := TMyObject.Create();
end;
end;