SRL Archive - SRL Bugs

SetAutoingDefaults (loses focus).


mastaraymond

2010-02-13 08:37:07

When you are in SetAutoingDefaults will put Runescape in SafeMode.. However when it does this, runescape gets a new handle.. And thus the focus will be lost. (Not with SMART).

There isn't really a way to fix this problem, other than asking the user to target the Runescape client again.

(No FindWindowBySize isn't a cool solution).

Any other thoughts about this?

Frement

2010-02-13 08:38:03

From: mastaraymond
When you are in SetAutoingDefaults will put Runescape in SafeMode.. However when it does this, runescape gets a new handle.. And thus the focus will be lost. (Not with SMART).

There isn't really a way to fix this problem, other than asking the user to target the Runescape client again.

(No FindWindowBySize isn't a cool solution).

Any other thoughts about this?


Cant the window be identified by the title?

mastaraymond

2010-02-13 08:40:35

From: Frement
Cant the window be identified by the title?

Well the problem is one might have multiple Runescape's open.. In that case it is likely that it will find the wrong window..

Frement

2010-02-13 09:21:30

From: mastaraymond
Well the problem is one might have multiple Runescape's open.. In that case it is likely that it will find the wrong window..


Before SetAutoingDefaults it would get all handles, after it it would get them again, and the one that has changed would be set as the new handle.

mastaraymond

2010-02-13 09:50:55

From: Frement
Before SetAutoingDefaults it would get all handles, after it it would get them again, and the one that has changed would be set as the new handle.

Now that would be a solution indeed. I'm not sure if scar/simba is capable of doing that though.

Frement

2010-02-13 09:51:46

How about a plugin? I could try one with C++.

Wizzup?

2010-02-13 10:46:23

I think asking to user to select the new one isn't such a bad idea at all.

NCDS

2010-02-13 11:12:35

Me and IceFire tried a bunch of stuff in this thread a few days ago..
http://www.villavu.com/forum/showthread.php?t=54827

Frement

2010-02-13 11:26:00

From: NCDS
Me and IceFire tried a bunch of stuff in this thread a few days ago..
http://www.villavu.com/forum/showthread.php?t=54827


Did you find a working solution?

NCDS

2010-02-13 12:34:50

No, me nor IceFire could come up with a solution.

Frement

2010-02-13 15:39:58

If we find the webclient window which has RuneScape title. Its the matter of finding the right child window, right?

mastaraymond

2010-02-14 05:46:03

From: Frement
If we find the webclient window which has RuneScape title. Its the matter of finding the right child window, right?

Well, you just need to retrieve a list of all the windows available in Windows and then loop through them to find a possible runescape client..

Frement

2010-02-14 06:05:41

From: mastaraymond
Well, you just need to retrieve a list of all the windows available in Windows and then loop through them to find a possible runescape client..


I think the class is SunAwtCanvas, but the problem is that there might be many. I dunno if it really matters.

E: Im gonna try to find it with the main handle.
E2: Ok, so we are going to have a small problem here. As Different browsers are used, they have different child window names / classes. Like in mozilla it could go like this:
+-MozillaUIWindowClass
|--> MozillaWindowClass
|---> MozillaWindowClass
|----> MozillaWindowClass
|-----> MozillaContentWindowClass
|------> MozillaWindowClass
|-------> MozillaWindowClass
|--------> MozillaWindowClass
|---------> SunAwtFrame
|----------> SunAwtCanvas
|-----------> SunAwtCanvas
|------------> SunAwtCanvas
+-------------> SunAwtCanvas

E3: Ok so i did a little snippet to show you how they go in opera.

E4: And i tested the same with FireFox :)

E5: So far i've got the big canvas.

E6: Got the right canvas, now only some final adjustments :)

E7: I ran into another problem, in Mozilla FireFox the Canvas' form differently compared to Opera.
Well I could make it detect what kind of browser it is. IE & FF has the same method, only Opera differs.

Any opinions / suggestions?

E8: Tested to work with: Opera, Chrome, FireFox, Internet Explorer

E9: Here is a plugin, but the problem is that it gives runtime errors, access violation.

http://pastebin.com/f492fb9f3

Works fine in my test app, but in scar does not return the handle to the main window.
begin
Writeln( IntToStr( FindWindowByTitle( 'RuneScape -' ) ) );
end.