From e7776b74a7cbbfe8be08d5d9ef577508f08bb632 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:05:47 +1000 Subject: [PATCH] feat(windows): oops checkin in new system-main-pas --- .../main/Keyman.Configuration.System.Main.pas | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 windows/src/desktop/kmshell/main/Keyman.Configuration.System.Main.pas diff --git a/windows/src/desktop/kmshell/main/Keyman.Configuration.System.Main.pas b/windows/src/desktop/kmshell/main/Keyman.Configuration.System.Main.pas new file mode 100644 index 0000000000..f03c74cfd1 --- /dev/null +++ b/windows/src/desktop/kmshell/main/Keyman.Configuration.System.Main.pas @@ -0,0 +1,56 @@ +unit Keyman.Configuration.System.Main; + +interface + +uses + comobj, + Forms, + SysUtils, + ActiveX, + + Keyman.System.CEFManager, + + Keyman.System.KeymanSentryClient, + Sentry.Client, + Sentry.Client.Vcl, + Keyman.Configuration.System.UmodWebHttpServer, + initprog; + +procedure RunKeymanConfiguration; + +implementation + +const + LOGGER_DESKTOP_KMSHELL = TKeymanSentryClient.LOGGER_DESKTOP + '.kmshell'; + +procedure RunKeymanConfiguration; +begin + TKeymanSentryClient.Start(TSentryClientVcl, kscpDesktop, LOGGER_DESKTOP_KMSHELL, LoadKeymanDesktopSentryFlags); + try + CoInitFlags := COINIT_APARTMENTTHREADED; + FInitializeCEF := TCEFManager.Create; + try + if FInitializeCEF.Start then + try + Application.Initialize; + Application.Title := 'Keyman Configuration'; + Application.CreateForm(TmodWebHttpServer, modWebHttpServer); + try + Run; + finally + FreeAndNil(modWebHttpServer); + end; + except + on E:Exception do + SentryHandleException(E); + end; + finally + FInitializeCEF.Free; + end; + finally + TKeymanSentryClient.Stop; + end; +end; + + +end.