Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- WindowTitle = 'muistio'; // NOTE: Open AT LEAST 2 window's which ALL contain this title (or part of the title..)!
- var
- cl: array of TSCARWindowClient;
- h, i, tm: Integer;
- function StartScript: Boolean;
- var
- HWDC: THwndArray;
- begin
- HWDC := FindWindowsEx(GetDesktopWindow, WindowTitle, '', False, False, True);
- h := High(HWDC);
- if (h < 1) then
- begin
- SetLength(HWDC, 0);
- Exit;
- end;
- SetLength(cl, (h + 1));
- for i := 0 to h do
- cl[i] := TSCARWindowClient.Create(HWDC[i]);
- SetLength(HWDC, 0);
- Result := True;
- end;
- begin
- if not StartScript then
- begin
- WriteLn('Failed to find 2(+) window''s with "' + WindowTitle + '".');
- TerminateScript;
- end;
- repeat
- for i := 0 to h do
- begin
- cl[i].Activate;
- tm := GetSystemTime;
- repeat
- Wait(1);
- until (GetKeyState(VK_F12) or ((GetSystemTime - tm) >= 500));
- end;
- Wait(10);
- until GetKeyState(VK_F12);
- SetLength(cl, 0);
- end.
Advertisement
Add Comment
Please, Sign In to add comment