View previous topic :: View next topic |
Author |
Message |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Mon Oct 08, 2007 8:32 am Post subject: Question about "sendmessage" (C++/API) |
|
|
Hi, I know you can simulate mouseclicks etc. on a minimized Window with "SendMessage".
Is it possibly to send a Message (with SendMessage) for talking to NPC's without clicking on them?
Another question:
How does plugin's work for example winamp or something like that.
There plugin (or an external programm) can play/pause/next etc on winamp.
Are those plugin's also working with SendMessage?
greez
Last edited by redhead on Mon Oct 08, 2007 9:17 am; edited 1 time in total |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Oct 08, 2007 8:42 am Post subject: Re: Question about "sendmessage" (C++/API) |
|
|
redhead wrote: | Hi, I know you an simulate mouseclicks etc. on a minimized Window with "SendMessage".
Is it possibly to send a Message (with SendMessage) for talking to NPC's without clicking on them?
Another question:
How does plugin's work for example winamp or something like that.
There plugin (or an external programm) can play/pause/next etc on winamp.
Are those plugin's also working with SendMessage?
greez |
For your 2nd question about Winamp, yes, they use SendMessage. Winamp is designed to handle its own messages through send message using WM_COMMAND.
The commands for Winamp are:
Code: | #define WA_PREV 0x9C6C
#define WA_PLAY 0x9C6D
#define WA_PAUSE 0x9C6E
#define WA_STOP 0x9C6F
#define WA_NEXT 0x9C70 |
Then to send the message you would use:
Code: | SendMessage(hwndOfWinamp, WM_COMMAND, WA_PLAY, NULL); |
And so on for the others as well.
Oh and another note, other players like iTunes have their own COM interface to use to communicate between itself and your program which is more reliable then using SendMessage. Winamp however doesn't come with one built in. But there are plugins for it.
|
|
Back to top |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Mon Oct 08, 2007 9:21 am Post subject: |
|
|
Thx.
Another Question to Winamp:
Is there a way to find thos "codes" manually? (With "codes" I mean 0x9C6C for example)
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Oct 08, 2007 2:12 pm Post subject: |
|
|
redhead wrote: | Thx.
Another Question to Winamp:
Is there a way to find thos "codes" manually? (With "codes" I mean 0x9C6C for example) |
Yes, you can use an API spy on Winamp and then press the play, pause, etc buttons which should return the use of those codes with SendMessage. I found them that way a few versions ago. Windows Media Player works the same way too.
|
|
Back to top |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Tue Oct 09, 2007 8:49 am Post subject: |
|
|
Could you give an example of how to using the command "spy" ?
Or just give a link to msdn with this command or whatever..I only find crap when I'm searching for the command spy...
|
|
Back to top |
|
 |
DeltaFlyer Grandmaster Cheater
Reputation: 0
Joined: 22 Jul 2006 Posts: 666
|
Posted: Tue Oct 09, 2007 4:30 pm Post subject: |
|
|
It's not a command, it's a type of program. Visual Studio comes with one called Spy++. It should be under the Tools folder of your installation with the name spyxx.exe.
Once Spy++, hit ctrl+w to open a new window list. Find the window you wish to capture, right click on it, and choose messages. Now, all messages sent to the window will be captured.
_________________
Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for? |
|
Back to top |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Wed Oct 10, 2007 6:15 am Post subject: |
|
|
Thx.This programm works fine, but somehow it have been created..maybe some1 knows how I can make an own programm that "spys" messages?
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Oct 10, 2007 6:43 am Post subject: |
|
|
redhead wrote: | Thx.This programm works fine, but somehow it have been created..maybe some1 knows how I can make an own programm that "spys" messages? |
Subclass the WNDPROC of the program using SetWindowLongPtr which will give you access to the main message loop of the window.
|
|
Back to top |
|
 |
|