1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| //------------------------------------------------------------------------------
class function TSliteModuleTool.IsCitrix(ATransparentSeamlessModeActivated: PBoolean = nil; AIsRemotedSessionWithoutCitrix: PBoolean = nil): Boolean;
const
WND_HOOK_CLASSNAME = 'Seamless Host Agent - Active Accessibility Hooking Window';
WND_HOOK_CLASSTEXT = 'Agent de transparence hôte - Fenêtre de hook d''accessibilité active';
WND_ICAATH_CLASSNAME = 'Seamless Host Agent - user mode support';
WND_ICAATH_CLASSTEXT = 'Agent d''hôte transparent ICA';
WND_SHELL_CLASSNAME = 'WFShell';
WND_SHELL_CLASSTEXT = 'WFShell';
WND_SHELLW_CLASSNAME = 'WFShellWnd';
WND_SHELLW_CLASSTEXT = 'WFShellWindow';
WND_ICACCS_CLASSNAME = 'ICA Control Channel support';
var
RemotedSession, TransparentMode, CitrixFound: Boolean;
begin
Result := False;
RemotedSession := IsRemoteSession();
if Assigned(AIsRemotedSessionWithoutCitrix) then
AIsRemotedSessionWithoutCitrix^ := RemotedSession;
if RemotedSession then
begin
// Si l'on détecte la transparence, c'est que c'est bien du Citrix
TransparentMode := (FindWindow(WND_HOOK_CLASSNAME, WND_HOOK_CLASSTEXT) <> 0) or (FindWindow(WND_HOOK_CLASSNAME, nil) <> 0) or (FindWindow(nil, WND_HOOK_CLASSTEXT) <> 0);
// On cherche toutes les autres fenêtres Citrix connue pour le moment
CitrixFound := TransparentMode
or (FindWindow(WND_SHELL_CLASSNAME, WND_SHELL_CLASSTEXT) <> 0) or (FindWindow(WND_SHELL_CLASSNAME, nil) <> 0) or (FindWindow(nil, WND_SHELL_CLASSTEXT) <> 0)
or (FindWindow(WND_SHELLW_CLASSNAME, WND_SHELLW_CLASSTEXT) <> 0) or (FindWindow(WND_SHELLW_CLASSNAME, nil) <> 0) or (FindWindow(nil, WND_SHELLW_CLASSTEXT) <> 0)
or (FindWindow(WND_ICACCS_CLASSNAME, nil) <> 0)
or (FindWindow(WND_ICAATH_CLASSNAME, WND_ICAATH_CLASSTEXT) <> 0) or (FindWindow(WND_ICAATH_CLASSNAME, nil) <> 0) or (FindWindow(nil, WND_ICAATH_CLASSTEXT) <> 0);
Result := CitrixFound;
if CitrixFound and Assigned(ATransparentSeamlessModeActivated) then
ATransparentSeamlessModeActivated^ := TransparentMode;
end;
end; |
Partager