Solved

How to press the play button in winamp by pressing a button on my program ?

Posted on 2000-03-27
6
330 Views
Last Modified: 2013-12-03
I have a simple program with a window and a button. I want to press this button and the winamp which is already opened starts playing as if I had press the play button on it. How can I do this ? What do I need to know ?
0
Comment
Question by:redhat092798
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
ID: 2660603
You can use Spy or a similar utility to look at the parameters that are sent with the WM_COMMAND message that is produced when you press the play button on this winamp application.  Then you can make your application send a WM_COMMAND message with the same parameters to the winamp application.
0
 

Author Comment

by:redhat092798
ID: 2661158
" Then you can make your application send a
WM_COMMAND message with the same parameters to the winamp application."

I need a little more specifics from this sentence, namely,
1) You mean I do a SendMessage() or a PostMessage() ?

2)"to the winamp application" , I think I will need the handle or something of the winamp application, right ?

Thanks.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2661442
>> 1) You mean I do a SendMessage() or a PostMessage() ?
Either would be fine.

>> I think I will need the handle or something of the
>> winamp application, right ?
A handle to its main window.  You probably can use FindWindow() to find the window.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:redhat092798
ID: 2662742
I checked using Spy++ , when I press the play button on winamp, it sends  WM_COMMAND message and the
wparam  :  00009C6D
lParam    :  00000000

also pressing the stop button sends a WM_COMMAND messages,
wParam : 00009C6F
iParam   : 00000000

Is this the info I need ? Can you explain a little more please. A little code snippet would be nice.
Thanks.
 
0
 
LVL 22

Expert Comment

by:nietod
ID: 2663942
>> Is this the info I need ?
Yes.

You will need to get a handle to the window somehow, perhaps by using its title and the class name in FindWindow().

then you can try just doing

SendMessage(WndHnd,WM_COMMAND,0x00009c6d,0);

which specifies NULL for the control that is sending the message.  if that doesn't work, you'll need to get the controll's handle (each time the program runs, because this will change, where as the WPARAM value shoud, not change.) usign the control's id which is in the low word of the WPARAM   So something like

HWND CtrlHnd = GetDlgItem(WndHnd,0x9c6d);

then

SendMessage(Wndhnd,WM_COMMAND,0x00009c6d,(LPARAM) CtrlHnd);
0
 

Author Comment

by:redhat092798
ID: 2671035
Thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question