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 


Question about "sendmessage" (C++/API)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Mon Oct 08, 2007 8:32 am    Post subject: Question about "sendmessage" (C++/API) Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Oct 08, 2007 8:42 am    Post subject: Re: Question about "sendmessage" (C++/API) Reply with quote

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
View user's profile Send private message Visit poster's website
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Mon Oct 08, 2007 9:21 am    Post subject: Reply with quote

Thx.
Another Question to Winamp:
Is there a way to find thos "codes" manually? (With "codes" I mean 0x9C6C for example)
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Oct 08, 2007 2:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Tue Oct 09, 2007 8:49 am    Post subject: Reply with quote

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
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Tue Oct 09, 2007 4:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Wed Oct 10, 2007 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Oct 10, 2007 6:43 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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