Specifications

COM+ reference
Gallagher & Robertson Glink: API reference manual 21
Here is an example of a simple GlinkApi event handler:
procedure TForm1.GlinkApi1onGlinkEvent(Sender: TObject;
var glevent: OleVariant);
var
S : string;
C : string;
E : integer;
V : integer;
GlApi : IGlinkApi;
Ev : IGlinkEvent;
begin
Ev := IDispatch(event) as IGlinkEvent;
E := Ev.getEventCode;
V := Ev.getValue;
GlApi := IDispatch(Ev.getSource) as IGlinkApi;
if E = GlinkEvent_ERROR_DETECTED then
S := 'ERROR_DETECTED: '+event.getValueText;
if E = GlinkEvent_COMMAND_KEY_TYPED then
begin
S := 'COMMAND_KEY_TYPED: '+IntToStr(V);
GlApi.sendCommandKey(V);
end;
if E = GlinkEvent_KEY_TYPED then
begin
C := Ev.getValueText;
S := 'KEY_TYPED: '+ C;
GlApi.sendKeys(C, nil);
end;
if E = GlinkEvent_MESSAGE_MODE_DATA then
S := 'MESSAGE_MODE_DATA';
if E = GlinkEvent_PRINT_DATA then
S := 'PRINT_DATA';
if E = GlinkEvent_STRING_RECEIVED then
begin
S := 'STRING_RECEIVED: id: '+IntToStr(V);
case V of
1 :
begin (* 'LOGICAL ID--' *)
GlApi.sendKeys ('myuserid', nil);
GlApi.sendCommandKey (GlinkKey_TRANSMIT);
GlApi.sendKeys ('logo', nil);
GlApi.sendCommandKey (GlinkKey_TRANSMIT);
GlApi.notifyString('password', true, 2,
false);
GlApi.notifyKey(-1);
GlApi.notifyCommandKey(-1);
end;
2 :
begin (* 'password' *)
S := S + ': received password';
end;