@@ -12,7 +12,7 @@ interface
1212uses
1313 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
1414 Menus, ImgList, AnchorDockPanel, LMessages,
15- simba.base, simba.settings, simba.ide_mouselogger;
15+ simba.base, simba.settings, simba.ide_mouselogger, simba.image ;
1616
1717const
1818 IMG_NONE = -1 ;
@@ -251,7 +251,7 @@ TSimbaMainForm = class(TForm)
251251 // Handle main menu shortcuts if editor is focused
252252 procedure DoApplicationKeyDown (Sender: TObject; var Key: Word; Shift: TShiftState);
253253 procedure DoTabLoaded (Sender: TObject);
254- function DoGetWindowForACA : TWindowHandle ;
254+ function DoGetWindowForACA : TSimbaImage ;
255255
256256 procedure SetCustomFontSize (Value : Integer);
257257 procedure SetLayoutLocked (Value : Boolean);
@@ -291,8 +291,7 @@ implementation
291291 simba.aca, simba.dtmeditor, simba.env, simba.ide_dockinghelpers, simba.nativeinterface,
292292 simba.ide_simpleformatter, simba.component_theme,
293293 simba.threading, simba.ide_editor, simba.vartype_string, simba.misc,
294- simba.target,
295- simba.vartype_windowhandle;
294+ simba.target;
296295
297296procedure TSimbaMainForm.HandleException (Sender: TObject; E: Exception);
298297
@@ -748,7 +747,11 @@ procedure TSimbaMainForm.MenuItemDocumentationClick(Sender: TObject);
748747
749748procedure TSimbaMainForm.MenuItemACAClick (Sender: TObject);
750749begin
751- ShowACA(@DoGetWindowForACA);
750+ with TSimbaACA.Create(@DoGetWindowForACA) do
751+ begin
752+ FreeOnClose := True;
753+ Show();
754+ end ;
752755end ;
753756
754757procedure TSimbaMainForm.DoMenuItemRunClick (Sender: TObject);
@@ -1047,12 +1050,9 @@ procedure TSimbaMainForm.DoTabLoaded(Sender: TObject);
10471050 AddRecentFile(TSimbaScriptTab(Sender).ScriptFileName);
10481051end ;
10491052
1050- function TSimbaMainForm.DoGetWindowForACA : TWindowHandle ;
1053+ function TSimbaMainForm.DoGetWindowForACA : TSimbaImage ;
10511054begin
1052- if (SimbaMainToolBar.WindowSelection = 0 ) or (not SimbaMainToolBar.WindowSelection.IsValid) then
1053- Result := GetDesktopWindow
1054- else
1055- Result := SimbaMainToolBar.WindowSelection;
1055+ Result := TSimbaImage.CreateFromWindow(SimbaMainToolBar.WindowSelectionOrDesktop);
10561056end ;
10571057
10581058procedure TSimbaMainForm.MenuEditClick (Sender: TObject);
0 commit comments