Author Topic: FindWindow(ClassName, WindowName), SetParent(Child, Parent), etc..  (Read 486 times)

Offline triumphost1

  • Newbie
  • *
  • Posts: 19
  • Rep: 0
    • View Profile
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..

Code: [Select]
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'

Code: [Select]
function FindSmart: HWND;
var
Smart: HWND;
begin
  Smart:= FindWindow('SunAwtFrame', 'Public SMARTv6.6 - SMART Minimizing Autoing Resource Thing - By BenLand100');
  result:= Smart;
end;

Code: [Select]
Procedure SetParentSmart(Sender: TObject);
var
  FormHandle: HWND;
    begin
        FormTitleBarName:= 'Form1';
        FormHandle:=  FindWindow('', FormTitleBarName);
        SetParent(FormHandle, FindSmart);
    end;

Code: [Select]
  HotKey:= FindWindow('', 'Form1');
  if RegHotKey(HotKey, 1, $4000, VK_F9) then
    writeln('Registered Hotkey');

Freddy1990.com


Offline Freddy

  • Owner
  • *****
  • Posts: 2616
  • Rep: 19
    • MSN Messenger - freddy1990@gmail.com
    • AOL Instant Messenger - Freddy199O
    • View Profile
    • Email
Re: FindWindow(ClassName, WindowName), SetParent(Child, Parent), etc..
« Reply #1 on: July 31, 2011, 08:55:33 am »
SCAR only waits for a form to close if you call ShowModal, as it should... If you call Show it will not wait. Also, FindWindow is already in SCAR, but it doesn't support classes and sets the found window as selected client. To keep backwards compatible I can't change this, however, I can introduce all of these features in SCAR 4.

Freddy1990.com

Re: FindWindow(ClassName, WindowName), SetParent(Child, Parent), etc..
« Reply #1 on: July 31, 2011, 08:55:33 am »

Offline triumphost1

  • Newbie
  • *
  • Posts: 19
  • Rep: 0
    • View Profile
Re: FindWindow(ClassName, WindowName), SetParent(Child, Parent), etc..
« Reply #2 on: August 18, 2011, 07:51:20 pm »
SCAR only waits for a form to close if you call ShowModal, as it should... If you call Show it will not wait. Also, FindWindow is already in SCAR, but it doesn't support classes and sets the found window as selected client. To keep backwards compatible I can't change this, however, I can introduce all of these features in SCAR 4.

I'd love for u to introduce it in titan.. it will be great!! I'd personally appreciate it as would many! Seeing as simba doesn't support this, I think it'd be great to have some new unique features.

as for the ShowModal vs show.. I wanted to have the form show and stay on screen but have the script continue running.. Sorry for late reply just been busy a lot!

Freddy1990.com

Re: FindWindow(ClassName, WindowName), SetParent(Child, Parent), etc..
« Reply #2 on: August 18, 2011, 07:51:20 pm »