Using Windows message control Winamp in VB

Source: Internet
Author: User
Tags file info set time

The first part: The window that gets Winamp

Winamp is a 32-bit Windows application. That is, we can use some of the basic techniques of 32-bit Windows programming to implement control Winamp, a message system that uses Windows. Before you send a message to Winamp, you must get a handle to the Winamp window. Here's a way to do this by using an external application, such as a VB application that you have written yourself.

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim hwndWinamp as long
hwndWinamp = FindWindow("Winamp v1.x",vbNullString)

You may notice a point, why use the class name "Winamp v1.x" to FindWindow? Because all versions of Winamp 1.x and 2.x are in the class name "Winamp v1.x".

Part II: Using messages

Winamp the corresponding three messages: Wm_user,wm_command, and Wm_copydata. Wm_user and Wm_copydata allow you to have some advanced control over the Winamp. And WM_COMMAND can do some simple things like pause, play, and jump to the next piece of music.

1.wm_command message:

Previous Track Button 40044

Next Track Button 40048

Play button 40045

Pause/unpause Button 40046

Stop Button 40047

Fadeout and Stop 40147

Stop after current track 40157

Fast-forward 5 seconds 40148

Fast-rewind 5 Seconds 40144

Start of Playlist 40154

Go to end of playlist 40158

Open File Dialog 40029

Open URL Dialog 40155

Open File info Box 40188

Set time display mode to elapsed 40037

Set time display mode to remaining 40038

Toggle Preferences Screen 40012

Open Visualization Options 40190

Open Visualization Plug-in Options 40191

Execute Current Visualization Plug-in 40192

Toggle About Box 40041

Toggle title Autoscrolling 40189

Toggle always on top 40019

Toggle WindowShade 40064

Toggle Playlist WindowShade 40266

Toggle doublesize Mode 40165

Toggle EQ 40036

Toggle Playlist Editor 40040

Toggle main Window Visible 40258

Toggle Minibrowser 40298

Toggle Easymove 40186

Raise Volume by 1% 40058

Lower Volume by 1% 40059

Toggle Repeat 40022

Toggle Shuffle 40023

Open jump to Time dialog 40193

Open jump to File Dialog 40194

Open Skin Selector 40219

Configure Current Visualization Plug-in 40221

Reload the current skin 40291

Close Winamp 40001

Moves back tracks in playlist 40197

Show the edit bookmarks 40320

Adds current track as a bookmark 40321

Play Audio CD 40323

Load a preset from EQ 40253

Save a preset to EQF 40254

Opens Load Presets dialog 40172

Opens Auto-load Presets Dialog 40173

Load Default Preset 40174

Opens Save Preset dialog 40175

Opens Auto-load Save preset 40176

Opens Delete Preset dialog 40178

Opens delete an auto load Preset dialog 40180

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.