cyanidemonkey Posted December 7, 2006 Posted December 7, 2006 (edited) I found this AutoIt code on another forum when looking at a way to start WinAmp and setting the volume. I have WinAmp 2.95 installed but it always has the pop up saying Winamp not found. The winamp forums said that winamp v1.x to v2.x uses a class name 'Winamp v1.x' Any ideas why it is not detecting WinAmp? Using AutoIt v3.2.0.1 ;There must be a problem with your VB code (I don't know enough to help you there). ;Here's how the program is written in AutoIt: Const $WM_USER = 0x400 Opt ("WinTitleMatchMode", 4);Sets the mode to 'classname=*' titlematch $WAhandle = ControlGetHandle("classname=Winamp v1.x", "", 0);Gets the Winamp Handle If @error = 1 Then MsgBox(16, "Fatal Error:", "Winamp not found.") Exit EndIf $input = InputBox("Enter Volume:", "Please enter the volume you wish to set" &@CRLF&"(0 - 100%):") If $input >= 0 AND $input <= 100 Then DllCall("user32.dll", "int", "SendMessage", "hwnd", $WAhandle, "int", $WM_USER, "int", ($input*255/100), "int", 122) ;Set the Volume to $input * 255 / 100 Else MsgBox(16, "Fatal Error:", "Value entered is not valid.") Exit EndIf Edited December 7, 2006 by cyanidemonkey My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Uten Posted December 7, 2006 Posted December 7, 2006 Check the classname with au3info.exe located in the same folder as autoit3.exe Also don't winamp have shortcut keys to adjust the volume? alt+arrow or something. You could use those and send the keyboard command directly to the top window. Guess that one would be easier to detect than the volume control. DISCLAIMER: I'm not using winamp Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
cyanidemonkey Posted December 7, 2006 Author Posted December 7, 2006 Checked it with au3info.exe, the class name is correct (Winamp v1.x) The reason for this is beacuse it is part of an automated start up, and I want to make sure the volume is set to 50%. (Part of an LPFM radio station set up, so the level must be correct) My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Moderators big_daddy Posted December 7, 2006 Moderators Posted December 7, 2006 You may want to take a look at the Winamp Automation Library I started.Winamp Automation Library
The Kandie Man Posted December 7, 2006 Posted December 7, 2006 Works fine for me Winamp 5.31 using autoit beta v3.2.1.12. My winamp classname is: Class: Winamp v1.x "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now