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
      Specify 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 these requests, lParam is an identifier for a named file-mapping
        object. 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, is returned.
      
        See Remarks for more information.
      
         800 Request current song (full filename)
             This request adds 2 additional bytes (= 1 character) after the
             terminating null character, specifying the current play state
             (lpdata + (length + 1) * 2 + 1), and operation state
             (lpdata + (length + 1) * 2 + 2).
             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.
         801 Request current song
             This request is identically to request 800, except the path is
             stripped from the filename.
         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.

  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 in lParam.

  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 frequencly processes messages; There is no advantage in
  functionality when using PostMessage instead of SendMessage.

  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

Unicode:
  All strings (copyied into file-mapping objects) are 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 may 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, hMapFile);
          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 QuickPlayer10046Msg 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

Text-queries:
-------------

  Use this with SendMessage to send a text-based query;
	hwnd	the handle of QuickPlayer10046Msg element
	uMsg	must be WM_COMMAND (273 / hex 111)
	wParam	request (id / number) as seen in the list below.
	lParam	Identifier for a named filemapping.
  Return value is the number of characters (!) copied. This queries always
  return unicode strings.
  
  e.g. Generate a random number which is used as Identifier, then generate a
  named filemapping; If your Identifier is 12, you may create the mapping:
  hMapFile = CreateFileMapping(Invalid_Handle, NULL, PAGE_READWRITE, 0, <Size>,
                               "quickplayer_12");
  and pass 12 as lParam when sending the message;
  For <Size>, specify the size in bytes; If your filemapping has insufficient
  space for the requested (NULL-terminated) string, the function fails.
  When successfull, it returns the lenght (in characters) of the copied string,
  not including the terminating NULL-character.
  

  Tip: - Use WideCharToMultiByte/MultiByteToWideChar to convert between Unicode
         and Ansi.

  dwData:
   800 Request current song; Uses 2 additional bytes (= 1 character) after the
       terminating null character, specifying the current play state (lpdata +
       (length + 1) * 2 + 1) and operation state (lpdata + (length + 1) * 2 + 2)
       This operation will fail if there is no song being playing/paused; It
       will never return 0 as play/operation state
   801 Same as 10, but provides filename without path
   81x Previous song list (80=simple with time, +1 for full paths, +2 to
                           suppress time, +4 to inverse list)




CopyData:
---------

  This method is used by QuickPlayer for passing playlists to another instance:
	hwnd	the handle of QuickPlayer10046Msg 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 (!)
                    dwData   request id;

  dwData:
    (0) used by previous versions;       ansi
     1  Pass playlist to load (open);    unicode
     2  Pass playlist to laod (enqueue); unicode

  Tip: - Use WideCharToMultiByte/MultiByteToWideChar to convert between Unicode
         and Ansi.



Notes:
------

  Use at your own risk.
