The Client for an Internet Access Control Application
Recently we finished a series covering the server side for an Internet access control application; now we're ready to take on the client. The client application is what the Internet users will see shortly before a workstation is activated or when a session is completed. It is responsible for both time and user access management as you will see in the rest of the series. Crucially, it is also responsible for processing all communication between itself and the server.
The Client for an Internet Access Control Application - Disable Mouse and Keyboard Access (Page 3 of 4 )
The next function is responsible for disabling mouse and keyboard access:
//screenblock function
function TForm1.FuncAvail(dllName, funcName: string; var p: pointer): boolean;
var
lib: THandle;
begin
result := false;
p := nil;
if LoadLibrary(PChar(dllName)) = 0 then exit;
lib := GetModuleHandle(PChar(dllName)) ;
if lib <> 0 then
begin
p := GetProcAddress(lib, PChar(funcName)) ;
if p <> nil then Result := true;
end;
end;
//***********end screenblock function
The parse functions should be familiar to you by now. They are responsible for breaking up text that is sent by the server to the client, as demonstrated above. The code for the function is listed below:
//*******string functions
function ParseString(s : string; var Token1,Token2,Token3: string) :
boolean;
var
P1,P2 : integer;
begin
P1 := Pos(':',s);
P2 := Pos('@',s);
//Test if both delimiters are present, in the right order and
//at least 1 char apart
if ((P1 > 0) and (P2 > 0) and (P2 > P1) and (Abs(P2-P1) > 1))