Solved

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

Posted on 2000-03-27
6
328 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
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need example 5 122
Need to create an object factory 2 47
Licensing Sharepoint 2016 for developers 11 62
PL SQL Developer 7 55
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared 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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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