Jump to content
TroisVerites

Help with the new system TSCARWindowClient

Recommended Posts

version = Scar 3.35 RC

I have problem with the new system. I Can not update the target Client Window in the Scar IDE.

 

The Window is found and the code can activate it.

 

I think there is something wrong or missing but I don t know what.

 

Any help please, thanks

 


{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function Window_FindAndActivate(): boolean;
Contributors: TroisVerites
Description:
Date Created: March 01st, 2012. By TroisVerites Build 001
Last Modification:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function Window_FindAndActivate(): boolean;
{$IFDEF SCAR335_UP}
var
 Windows: THwndArray;
 WindowClient: TSCARWindowClient;  
{$ENDIF}
begin
 {$IFNDEF SCAR335_UP}
   if FindWindowTitlePart(WINDOW_NAME, false) then
   begin
     ActivateClient();
     Result := True;
   end;
 {$ELSE}    
   Windows := FindWindowsEx(GetDesktopWindow,WINDOW_NAME, '', False, False, True);
   if (Length(Windows) > 0) then
   begin
     WindowClient := TSCARWindowClient.Create(Windows[0]);
     if ( WindowClient <> nil ) then
     begin
       SetClient(WindowClient).Free; // Set client + free the old one 
       // SetClient is required to use colorfinding or mouse/keyboard I/O on the 
       // client, not required to activate it:
       WindowClient.Activate();

       Result := true;
     end; 
   end;
 {$ENDIF}
end;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...