| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Tue Nov 20, 2007 7:17 pm Post subject: How do you send keys to a window? |
|
|
| Can some1 give the script in delphi?
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Tue Nov 20, 2007 7:20 pm Post subject: |
|
|
FindWindow > PostMessage
_________________
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Tue Nov 20, 2007 7:25 pm Post subject: |
|
|
Dun Work T.T
i am using:
wnd := FindWindow('Form1', nil);
//wnd := FindWindowEx(wnd, 0, 'hi', nil);
//PostMessage(wnd, WM_KEYDOWN, 0xLparamhere, 0xWparamhere);
asd:=2143214321;
PostMessage(wnd, WM_CHAR, asd, 0);
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Tue Nov 20, 2007 7:46 pm Post subject: |
|
|
Translate / dispatch message.
There is a post on it somewhere.
Search!
_________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Tue Nov 20, 2007 7:49 pm Post subject: |
|
|
| blankrider wrote: | Translate / dispatch message.
There is a post on it somewhere.
Search! |
No... that method is not as good.
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Tue Nov 20, 2007 8:01 pm Post subject: |
|
|
| You can also use SendInput(), but it isn't window based.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Tue Nov 20, 2007 8:06 pm Post subject: |
|
|
Can you fix it for me?
I am new to delphi 7...
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Tue Nov 20, 2007 8:30 pm Post subject: |
|
|
It's very good sponge
It's basically communicating on the lowest level.
Fill a MSG structure with your keystroke info then send it. It's core windows communication.
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Tue Nov 20, 2007 8:32 pm Post subject: |
|
|
| blankrider wrote: | It's very good sponge
It's basically communicating on the lowest level.
Fill a MSG structure with your keystroke info then send it. It's core windows communication. |
Ahaha, you do know what kernel mode is, and what the HAL's are don't you? Lowest level my ass...
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Tue Nov 20, 2007 8:59 pm Post subject: |
|
|
Lowest user mode interaction. I was assuming he isn't going to write a driver for sending simple keys...that would just be silly.
_________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Tue Nov 20, 2007 9:01 pm Post subject: |
|
|
No it isn't. Eventually it will result in an error code 5 (No access error.) in MS.
i haven't tested it in other processes.
maybe it has something to do w/ ms's bloated wndproc but i have no idea.
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Tue Nov 20, 2007 9:05 pm Post subject: |
|
|
maybe if you're retarded
and besides he never said this is for MS. MS sucks, get over it....
_________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Tue Nov 20, 2007 9:06 pm Post subject: |
|
|
If you didn't notice this was moved from the MS section. The safest thing to say is that he is doing this for MS. Besides why call 2 api when you can call one.
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Tue Nov 20, 2007 9:13 pm Post subject: |
|
|
Because you should always use a lower level approach to anything.
Besides, SendInput is blocked in maplestory. I don't think translate/dispatch message is. And i'm pretty sure SendInput is a wrapper for t/d msgs ...
And call 2 api because it's faster and more efficient.
_________________
|
|
| Back to top |
|
 |
|