Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2000-03-27
6
Medium Priority
?
337 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 200 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

963 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