Results 1 to 8 of 8

Thread: SendMessage API???

  1. #1

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228

    Question SendMessage API???

    Ok, i know you can completely control an external program by using the SendMessage API to tell it to do anythin as long as u have the message handles....... How do i figure out what to send to the program to make it do stuff... i am talking about program specific stuff, not like WM_DESTROY, but stuff that would be different for each program... (Ex: Making Windows Media Player open a song or Starting a new game in Solitaire).. does anyone know how to do this..... is it even possible?!?
    To protect time is to protect everything...

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I wouldn't have though you'd have that much specific control, the sendmessage is a call for common procedures all program window/handles have such as the wm_destroy.

    Many of the programs like media player have their own api's, you can add references or components in your vb apps to access these api's and control these program specific calls

    Nice avatar by the way

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    I would think the PostMessage would be more along the lines of what you are looking for than SendMessage.

  4. #4
    jim mcnamara
    Guest
    There are DOZENS of windows messages. Every possible command translates to a different message. This is how the OS talks to a window when you type or move the mouse. For text stream entry and regular commands, use PostMessage - it puts the message in a queue behind the other messages wating to process. SendMessage puts the message at the front of the queue - usually to do something like close a window.

    Goto www.msdn.microsoft.com Search for Windows messages.
    You'll get the WM_ series of messages (WM_QUIT WM_DESTROY are the ones you see on VBFORUMS the most. The others are much more useful). Start there. For editboxes: EB_ messages, for listboxes: LB_ messages

    You can also get help in visual studio (VB help) goto to the index tax, type WM_ or EB_ or LB_.

  5. #5
    Megatron
    Guest
    Messages are usually generic, unless an application creates a custom message via RegisterWindowMessage or WM_USER. Also, it's highly unlikely that an application that is not meant to have "add-ons" has custom messages (e.g: Soliatre). Because of this, you'll sometimes need to send a couple generic messages to perfrom a task.

  6. #6
    New Member
    Join Date
    Mar 2005
    Posts
    3

    Re: SendMessage API???

    Can someone give me an example of how to stop/play a file using the SendCommand in Windows Media Player??? (PM me the code)
    Last edited by daniel142005; Mar 23rd, 2005 at 01:15 AM.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: SendMessage API???

    Boy, here is a resurrected blast from the past (opened in 2001).

    When you say "stop/play a file", I assume you mean a .wav file. Would that be correct? Is this the command you were referring to? mciSendCommand

  8. #8
    New Member
    Join Date
    Mar 2005
    Posts
    3

    Re: SendMessage API???

    Quote Originally Posted by Hack
    Boy, here is a resurrected blast from the past (opened in 2001).

    When you say "stop/play a file", I assume you mean a .wav file. Would that be correct? Is this the command you were referring to?
    i meant any file that Windows Media Player supports

    ( found out how to play/stop/pause the music, but not how to go to the next/previous song... Do you know the MCI command for this? )
    Last edited by daniel142005; Mar 23rd, 2005 at 05:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width