Press_ALT_F4 Posted October 18, 2013 Share Posted October 18, 2013 hi, how can i target a window in the script? for example the window-title is "game" hope for answer bye Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 18, 2013 Share Posted October 18, 2013 hi, how can i target a window in the script? for example the window-title is "game" hope for answer bye You can use the window API. FindWindows - SCAR Divi Manual and FindWindowsEx - SCAR Divi Manual should be what you're looking for. Once you have the windowhandle you need, just do SetClient(TSCARWindowClient.Create(YourHandle)).Free; Quote Link to comment Share on other sites More sharing options...
Press_ALT_F4 Posted October 19, 2013 Author Share Posted October 19, 2013 Hi, thanks for your answer . its not work what is wrong in my script? activating is working but not targeting. FENSTER := FindWindowsEx(GetDesktopWindow, 'game', '', False, False, True); if Length(FENSTER) > 0 then begin ActivateWindow(FENSTER[0]); SetClient(TSCARWindowClient.Create(FENSTER[0])).Free; result:=true; end; hope for answer, bye Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 19, 2013 Share Posted October 19, 2013 That will effectively target the client, there's no doubt about it. Do keep in mind that it won't change the client that SCAR's IDE is targeting. Quote Link to comment Share on other sites More sharing options...
Wanted Posted October 19, 2013 Share Posted October 19, 2013 There's some good tutorials for SCAR@ SCAR Divi Manual Quote Link to comment Share on other sites More sharing options...
Press_ALT_F4 Posted October 21, 2013 Author Share Posted October 21, 2013 @freddy sry my english is to bad and the translator makes no sence. you mean i cant target a other window? @wanted i know this site, its very good but english and the functions for this problem dont work for me and i dont know why Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 21, 2013 Share Posted October 21, 2013 @freddy sry my english is to bad and the translator makes no sence. you mean i cant target a other window? No, you can target the window just fine, but the code doesn't change the target window for SCAR globally, just for the script when it runs. Quote Link to comment Share on other sites More sharing options...
Press_ALT_F4 Posted October 22, 2013 Author Share Posted October 22, 2013 thanks for answer, thats what i want when the script is running set a target. when i run the script it dont work. in the view "target client" is no changing to see. Quote Link to comment Share on other sites More sharing options...
FHannes Posted October 22, 2013 Share Posted October 22, 2013 thanks for answer, thats what i want when the script is running set a target. when i run the script it dont work. in the view "target client" is no changing to see. Yes, as I said, the client is not changed globally, just for the script. The target client box is part of the IDE, it has nothing to do with the script that's running. Quote Link to comment Share on other sites More sharing options...
Press_ALT_F4 Posted October 23, 2013 Author Share Posted October 23, 2013 thanks it works i was a little bit confused because the IDE no changed Quote Link to comment Share on other sites More sharing options...