Subclassing

From Winamp Developer Wiki
Revision as of 15:13, 25 September 2008 by Tarik (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Subclassing

Subclassing is a technique common to Windows development. It involves supplying your own window function for someone's window, and changing behavior by supplying your own logic for processing certain messages.

Because your plugin is given Winamp's HWND during initialization, it is possible for your plugin to subclass Winamp's main window. Since the Send Message API is built by sending messages to the Winamp window, your plugin can do a great deal without even effecting the UI. From simple notifications (e.g. Winamp sends msg=WM_WA_IPC, wParam=IPC_CB_MISC_TITLE, lParam=IPC_CB_MISC on song change) to radically altering behavior (e.g. Winamp checks the return value of msg=WM_WA_IPC, lParam=IPC_GET_NEXT_PLITEM to allow plugin's to override playlist playback order).