TroisVerites Posted August 14, 2012 Share Posted August 14, 2012 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; Quote Link to comment Share on other sites More sharing options...
LordJashin Posted August 14, 2012 Share Posted August 14, 2012 Did you set the WINDOW_NAME variable? Also it is not required you have () after empty functions and such. Quote Link to comment Share on other sites More sharing options...
FHannes Posted August 14, 2012 Share Posted August 14, 2012 In SCAR 3.35 the target client in the IDE and that in the script are separated. The client in a script is updated when you change the one selected in the IDE, but not the other way around. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted August 16, 2012 Author Share Posted August 16, 2012 YEs It is not required. But for my experience , I prefer to work with strict method. Less problem after. Did you set the WINDOW_NAME variable? Also it is not required you have () after empty functions and such. Quote Link to comment Share on other sites More sharing options...