Thread: Receiving Messages from other Applications

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    17

    Receiving Messages from other Applications

    I've done quite a lot of research over the past few days, and I'm still a bit puzzled on how to go about this.

    I've had a lot of practice Sending messages... but it's rather difficult for me to get them.

    I'm making a program that interfaces with Winamp (it's not a winamp plugin). I can send messages easily to winamp, but the main problems I'm having are...

    1) Receiving messages from Winamp
    The logic behind this mainly.. like when to know when the Winamp song changes

    2) Where to put such a loop that it will continue every few seconds.
    To check up on certain things, like the current song playing, and react accordingly...


    Any ideas?
    OS: Windows ME, Windows XP Pro
    Development Environment: MS VC++ 6.0 (SP3)
    Current Projects:
    none

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    132
    Well what you are looking for is more difficult then you may think. Its not a windows message that tells WinAMP to change songs. Instead its internal code in the program, windows itself has nothing to do with it. So receiving messages from WinAMP would be useless for this purpose.

    1) To check when WinAMP changes songs you would have to know what function is being called within WinAMP internally (as far as I know) and you would have to monitor WinAMP's function calls from the outside in order to catch these function calls.

    2) You can place the loop anywhere as long as your program goes into that loop and stays into that loop until you terminate your program.

    This may be a little vague, but its as much as I can give right now without spending more time in researching it myself. I haven't had a need to interface a program with another in such a way, at least not yet. If I come up with an answer I will let you know.

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    17
    Well, I've managed to get it to work... half assed..
    I made a seperate proc to get the song title (it takes it from winamp's title), and damn near hogs all the ram, so i've got to optimize that..
    I'll post some code when I get home later if I'm not too busy..
    OS: Windows ME, Windows XP Pro
    Development Environment: MS VC++ 6.0 (SP3)
    Current Projects:
    none

  4. #4
    Registered User
    Join Date
    Jun 2002
    Posts
    24
    Maybe you could sweet talk Nullsoft into letting you use there source code to make your own program, I doubt it, but it never hurts to ask.
    Keep smiling, it makes the big guys wonder what you're up to.

  5. #5
    Unregistered
    Guest
    Nullsoft publishes on their site the interfaces to get plugins to work. I'm sure they have a callback function that gets called when the song changes.

  6. #6
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    If you have MS Visual Studio, you can use Spy++ and see if any custom messages are sent when you change songs.

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You may want to look at the actual exe in a hex editor to see if you can find a function called "LoadSong" or some other logical name. You may be able to do a little reverse engineering. If you can figure you the actual function and all of its parameters you could try and monitor the memory location of that function during run-time and actually send info directly to the function. Once again, this will involve a little work. Plus your resulting program may not end up being compatible with other versions of windows, or even other machines

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CTabCtrl not receiving messages
    By VirtualAce in forum Windows Programming
    Replies: 3
    Last Post: 07-23-2009, 09:37 AM
  2. Spy++ view messages posted/sent to a control, or from it?
    By hanhao in forum Windows Programming
    Replies: 2
    Last Post: 06-24-2007, 11:07 PM
  3. A question about windows programming
    By Hussain Hani in forum Windows Programming
    Replies: 16
    Last Post: 05-23-2007, 07:38 AM
  4. Sending windows messages
    By Ideswa in forum Windows Programming
    Replies: 2
    Last Post: 03-02-2006, 01:27 PM
  5. Receiving messages from child of a child.
    By Sindol in forum Windows Programming
    Replies: 3
    Last Post: 01-26-2002, 07:58 AM