Use the SendMessage function to send requests to QuickPlayer

LRESULT SendMessage(
  HWND hWnd,      // handle of QuickPlayers messaging window
  UINT Msg,       // WM_COMMAND (273 / 111h)
  WPARAM wParam,  // Request
  LPARAM lParam   // NULL (not used), or handle to a file-mapping object for
                  // some commands
);

Parameters:
  hWnd
      The handle of QuickPlayers messaging window, which can be located using
      the FindWindow function
  Msg
      WM_COMMAND (273 / 111h)
  wParam
      Value specifying what to perform; This can be:
         200 Previous song
         201 Play / Restart
         202 (Un)Pause
         203 Stop
         204 Skip/Next song
         205 End Song
         220 Seek backward
         221 Seek forward
         222 Volume Up
         223 Volume Down
     230-240 Volume 0-100%
         300 Mark previous playlist item
         301 Play playlist item next / end/skip song (Playlist doubleclick
             action)
         302 Play playlist item (skip song)
         303 Play playlist item (end song)
         304 Play playlist item next
         305 Mark next playlist item
         306 Select current (/next) playlist item
         307 Select random playlist item
         318 PageUp playlist
         319 PageDown playlist
         320 Perform autorefresh
         330 Remove autorefresh songs
         331 Remove non-autorefresh songs
         340 Delayed autorefresh
         360 Abort directory reading
      Following settings toggle (x=0), or set on (x=1)/off (x=2):
         39x MP3 Infos
         400 Toggle Repeat mode
         401 Repeat single
         402 Repeat all
         403 Repeat random
         41x Fading (Fade in/out)
         42x Spectrum analyzer
         43x Remove missing songs
         44x Remove manually skipped/ended songs
         45x Remove played songs
         460 Toggle end-song-processing
         461 End-song-processing: off
         462 End-song-processing: crossfade
         463 End-song-processing: MiniDisk record mode
         464 End-song-processing: stop after each song
         465 End-song-processing: Toggle crossfade
         466 End-song-processing: Toggle MiniDisk record mode
         467 End-song-processing: Toggle stop after each song
         48x Intro mode
         510 IR-Sleeptime off
         512 IR-Sleeptime +30min
         513 IR-Sleeptime -30min
         515 IR-Sleeptime: 30min
         516 IR-Sleeptime: 60min
         517 IR-Sleeptime: 90min
         518 IR-Sleeptime: 120min
         590 Shutdown/Hibernate/Standby immediatelly
         600 Show/Restore QuickPlayer
         601 Hide/Minimize QuickPlayer
         610 Show current song title

      Text-based requests:
        For text-based queries, QuickPlayer uses file-mapping technology for
        interprocess communication. You must create a (unique?) named file-
        mapping object. As name for this object, use "quickplayer_" followed by
        an numeric expression (in dword range); That expression is later passed
        as lParam. E.g.: Create the filemapping:
          hMapFile = CreateFileMapping(Invalid_Handle, NULL, PAGE_READWRITE, 0,
                                       <Size>, "quickplayer_1234");
        and pass 1234 as lParam when sending the message;

        If your file-mapping object has insufficient space for the requested
        (NULL-terminated) string, the function fails. As the copied strings are
        unicode, you will need 2 bytes per character.

        If successfull, the length (in characters) of the string, not including
        the terminating NULL-character (or any extra data), is returned.

         800 Request current song (full filename / internet stream info)
             With version 1.00 beta 61+, the messaging window also supports
             WM_GETTEXT and WM_GETTEXTLEN, but returning the current song (full
             filename / extended internet stream info in format
               URL[<cr>Caption[|<cr>URL for recent playlist, or homepage...]]
             ) only, if not stopped/paused etc.!
             
             This request adds 6 additional bytes (!) after the terminating null
             character (2 bytes), specifying:
             (lpdata + (length + 1) * 2 + 1): operation state
             (lpdata + (length + 1) * 2 + 2): current play state
             (lpdata + (length + 1) * 2 + 3): type of music
             (lpdata + (length + 1) * 2 + 4): reserved
             (lpdata + (length + 1) * 2 + 5): the song length (4 bytes)
             If your file-mapping object has insufficient space for the
             requested (NULL-terminated) string plus this extra bytes, This
             request will fail.
             It will also fail if there is no song being playing/paused; Play/
             operation state will never be 0 (stopped) etc.
             If you don't need this extra information, just thread as a null-
             terminatedstring if successfull.

         801 Request current song
             This request is identically to request 800, except the path is
             stripped from the filename / it returns the best internet stream
             caption only.
         81x Request previous song list
             Songs will be seperated with an <CR><LF> (<13><10>) (There is no
             additional leading/trailing <CR><LF>);
             800 default list (time, filenames without path)
              +1 full filenames (including path)
              +2 suppress time
              +4 invert list

  lParam
      For text-based requests, an identifier for a named file-mapping object;
      All other requests do not need this parameter, so you should specify NULL.

Return values:
  Only specific requests have a return value, all other will simply return NULL.

Remarks:
  Older versions may not support all request, or the class name of the messaging
  window may differ.

  You can alternatively use the PostMessage function for all requests that do
  not return values or require reliable lParam data (e.g. file-mapping handles);
  Except if 'Playlist update interval (LockWindowUpdate)' is set to 'When done',
  QuickPlayer always frequencly processes messages; There is no advantage in
  functionality when using PostMessage instead of SendMessage, but execution of
  your application will continue immediatelly.

  Some functions will return a play/operation state:
    Playstates:
       0 stopped
       1 playing
       2 paused
    Operation states:
       0 stopped
       1 playing
       2 paused
       3=starting
       4=Applying soundcard
       5=Quitting
       6=Deleting files
       7=Reading files
       8=(Cross-)fading
    Music types:
       0 None
       1 Tracker
       2 Stream
       3 CDAudio
       4 InetStream

Unicode:
  The Windows 95, 98 and ME api has limited unicode support; you may want to use
  the returned string with the following functions: ExtTextOutW, GetCharWidthW,
  GetTextExtentExPointW, GetTextExtentPoint32W, GetTextExtentPointW, lstrlenW,
  MessageBoxExW, MessageBoxW, TextOutW.
         
  Use the WideCharToMultiByte/MultiByteToWideChar functions to convert between
  Unicode and Ansi.

Example:
(Hope a willing C programmer will test & fix this up...)

  To skip (end) the current song:
  -------------------------------
    #include "headers.h"
    HANDLE hWndQP;

    hWndQP = FindWindow("QuickPlayer10046CustomClassMSG", "QuickPlayer");
    if (hWndQP != NULL)
    {
      SendMessage(hWndQP, WM_COMMAND, 205, 0);
    }

  To request the current playing song:
  ------------------------------------
    #include "headers.h"
    HANDLE hWndQP;
    HANDLE hMapFile;
    LPVOID lpMapAddress;
    INT RetCode;

    hWndQP = FindWindow("QuickPlayer10046CustomClassMSG", "QuickPlayer");
    if (hWndQP != NULL)
    {
      hMapFile = CreateFileMapping(Invalid_Handle, NULL, PAGE_READWRITE, 0,
                                   $204, "quickplayer_1234");

      if (hMapFile != NULL)
      {
        lpMapAddress = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);
        if (lpMapAddress != 0)
        {
          // It is not required to map the file-mapping object before passing
          RetCode = SendMessage(hWndQP, WM_COMMAND, 800, 1234);
          if (RetCode != 0)
          {
            MessageBox(NULL, lpMapAddress, "Current playing song", MB_OK | MB_ICONINFORMATION);
          }
          UnmapViewOfFile(lpMapAddress);
        }
        CloseHandle(hMapFile);
      }
    }

Queries:
--------

  Use this with SendMessage to send a request;
	hwnd	the handle of QuickPlayer10046CustomClassMSG element
	uMsg	must be WM_COMMAND (273 / hex 111)
	wParam	request (id / number) as seen in the list below.
	lParam	not used (0)

  Requests:
    1   playstate
    2   operation state

CopyData:
---------

  This method is used by QuickPlayer for passing playlists to another instance:
	hwnd	the handle of QuickPlayer10046CustomClassMSG element
	uMsg	must be WM_COPYDATA (74 / hex 44)
	wParam	not used (0)
	lParam	pointer to valid COPYDATASTRUCT

  COPYDATASTRUCT -> lpData   pointer to accessable memory
                    cbData   buffer size in bytes(!); The string will be clipped
                             on a terminating null character, otherwise the full
                             size is used.
                    dwData   request id;

  dwData:
    (0) used by previous versions;                    ansi
     1  Pass playlist/directory/URL to load (open);   unicode
     2  Pass playlist/directory to load (enqueue);    unicode
     3  Pass URL to load;                             unicode
   All other values are reserved, but are always unicode
   For URLs, you can use this syntax:
     URL[<cr>Caption[|<cr>URL for recent playlist, or homepage...]]
   if no Caption/URL is specified, QuickPlayer uses stream information, if
   available.
   Returns 1 on success, 2 if another operation is still pending or 0 otherwise.
   The return value is no guaranty the desired action is performed because 
   QuickPlayer copies the data only and PostMessage itself and returms to your
   application immediately, while processing the data later.

  Tip: Use WideCharToMultiByte/MultiByteToWideChar to convert between Unicode
       and Ansi.
  Hint: If you pass "test", QuickPlayer will popup when processing the message;
        (If QuickPlayer isn't performing any interfering actions! Result is 1)

  Versions older than 1.00 beta 63a will not handle unicode request properly on
  non-Unicode systems (Win9x/Me) due a bug.


Notes:
------

  Use at your own risk.
