Oh awesome, I was thinking of contacting you, but I thought you only did payed stuff. Thanks so much for helping! I'll contact you
GOAT hasn't quite gotten round to looking at the code quite yet I don't think, he's probably busy. Here's my code (addressed to Villavu as I'm speaking in their chat): https://pastebin.com/V8Yn4tYx So, as I explain in the comments, the OSRS client (official) does not behave as any other application would, it does not obtain modality/doesn't get to be "in-focus" when interacting with it. This is a problem, as you will see if you run the code, when a user attempts to enter a string into the username or password entries, it doesn't register. For any beginners wanting to help, here's a good way of understanding the problem: open your internet browser (non-maximized), click onto the desktop and now try typing into the URL bar. You'll find that the text is not entered into the URL bar as the web browser is not in-focus. Now, this is no doubt some trickery from Jagex, as I've used this code in the past with other applications and it's worked just fine. Is there any way to ensure modality when interacting with the child program (the OSRS window)? Thanks in advance.
Unfortunately the job's probably not as simple as that, I already tried and it yielded the same results as if you were to click on the titlebar (so that it appears in focus), then if you were to click on the client (on one of the login fields, for example), out of focus. I've begun trying to implement some sort of method with SendMessage, SetForegroundWindow and GetForegroundWindow API's. However this might throw up the same problem. Off topic, but do you know of any ways to prevent the "Advertisement" error when loading 3 or more RuneScape client (happens in OSRS and the legacy RS3 client). I've had a review of the source for the legacy client, but I haven't managed to find a reference to anything about that error (yet). Do you know any solutions (apart from just opening them in quick succession). Thanks
Don't know anything about RS anymore really so I can't help with that ad error, but have you tried using SetFocus on other hwnds? There are usually a few in every process
They're not explicit processes as such that I can simply get the handle for and set, they're canvases - JNI/JAWT; SunCanvas. I'm still finding a solution. :|
FindWindowEx can get you child handles if you get the class name from Spy++ pinvoke.net: FindWindowEx (user32) Follow the instructions in the comments
Thank you for the insight blupig However, I've decided to try to create my own applet. It would do me some good to learn a bit of Java. This way I can bypass the un-bypassable "Unable to create advertisement" error - simply no solution for that when using the official client(s) except for just opening them in quick succession. Thanks for your help though.