Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[DELPHI] Sendin Input to a Java Applet in Firefox

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sat Dec 19, 2009 5:13 am    Post subject: [DELPHI] Sendin Input to a Java Applet in Firefox Reply with quote

Hello,
For sending a click to a Java Applett in Firefox I use this code:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  wnd: HWND;
begin
  wnd :=  FindWindow('MozillaUIWindowClass', '*** - Mozilla Firefox');
  wnd :=  FindWindowEx(wnd, 0, 'MozillaWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'MozillaWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'MozillaWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'MozillaContentWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'MozillaWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'MozillaWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'MozillaWindowClass', nil);
  wnd :=  FindWindowEx(wnd, 0, 'SunAwtFrame', nil);
  wnd :=  FindWindowEx(wnd, 0, 'SunAwtCanvas', nil);
  wnd :=  FindWindowEx(wnd, 0, 'SunAwtCanvas', nil);
  wnd :=  FindWindowEx(wnd, 0, 'SunAwtCanvas', nil);
  wnd :=  FindWindowEx(wnd, 0, 'SunAwtCanvas', nil);

  if wnd <> 0 then
  begin
    PostMessage(wnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(120, 220));
    PostMessage(wnd, WM_LBUTTONUP, 0, MAKELPARAM(120, 220));
  end;
end;


But the click is not executed although the messages are sent:


There is absolutely no problem sending clicks to a normal firefox window, but when the applet comes into play it just does not work. I also tried setting a delay or sending WM_LBUTTONDOWN two times, which Ive read on other forums but it doesnt help. Maybe anybody of you has already made some experience with this kind of stuff, so any help would be great.

_________________
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat Dec 19, 2009 8:00 pm    Post subject: Reply with quote

Try using an application like Spy++ to identify the correct window and then look at which specific messages it is handling
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 20, 2009 2:55 pm    Post subject: Reply with quote

As I already said, that is what I have done and the messages are sent according to Winspector (picture in my first post).
_________________
Back to top
View user's profile Send private message
MiLkz
Newbie cheater
Reputation: 0

Joined: 22 Feb 2009
Posts: 20

PostPosted: Mon Dec 21, 2009 11:03 am    Post subject: Reply with quote

I am almost 100% sure send/post message will not work for java apps

if there is another method/function that does work for java i do not know
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon Dec 21, 2009 11:34 am    Post subject: Reply with quote

You might want to try SendInput.
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Mon Dec 21, 2009 12:57 pm    Post subject: Reply with quote

Thank you guys for your answers,
@MiLkz That is what I am thinking too, I don't think that this problem can be solved.

@Jani SendInput is what I am currently using but I don't really like it because when my bot is running I can't do anything else, which would be possible only by using Send/Postmessage.

Isn't there any way to find and handle Java controls?

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Dec 22, 2009 7:36 pm    Post subject: Reply with quote

I wrote a bot for Minecraft a while ago that used SendInput

I just used a hotkey to stop it where it was at in case I needed to take control again. It was simple and worked fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites