The functions I have below I got to work in an extension in simba.. I would Love to see these in Scar.. and Another thing is that Scar waits until a form closes inorder for your script to continue.. Please make it so that the script can still run even if you have a form open..
function FindWindow(ClassName, WindowName: PChar): HWND; external 'FindWindowA@User32.dll stdcall';
function SetParent(Child, Parent: HWND): HWND; external 'SetParent@User32.dll stdcall';
function RegHotKey(WindowHandle: HWND; ID: integer; fsMod, VKCode: Cardinal): Boolean; external 'RegisterHotKey@User32.dll stdcall'
function FindSmart: HWND;
var
Smart: HWND;
begin
Smart:= FindWindow('SunAwtFrame', 'Public SMARTv6.6 - SMART Minimizing Autoing Resource Thing - By BenLand100');
result:= Smart;
end;
Procedure SetParentSmart(Sender: TObject);
var
FormHandle: HWND;
begin
FormTitleBarName:= 'Form1';
FormHandle:= FindWindow('', FormTitleBarName);
SetParent(FormHandle, FindSmart);
end;
HotKey:= FindWindow('', 'Form1');
if RegHotKey(HotKey, 1, $4000, VK_F9) then
writeln('Registered Hotkey');