Author Topic: DDE Command Key Query  (Read 17762 times)

SamK

  • Posts: 32
DDE Command Key Query
« on: 3 Aug '07 - 13:54 »
SCENARIO
I make extensive use of portable applications to reduce registry related problems.  XMPlay is my preferred portable, freeware music player in adopting this strategy.

XMP optionally creates a registry entry which enables a group of mp3 files (selected in Explorer) to be added to a currently playing track-list using a context menu choice in Explorer "Add to XMPlay-list".  I am attempting to mimic this ability without writing to the registry and using only portable, freeware tools.

TOOLS
Fast Explorer 2007 allows the creation of context menu entries (http://thesoftpro.tripod.com)
CMCDDE.exe is a command-line tool which sends DDE execute commands to any program (http://softwaregadgets.gridspace.net/2007/05/05/command-line-dde)

Using these two tools the behaviour of XMP can be successfully controlled from the Windows Explorer context menu by employing the XMP DDE commands shown in the Tips Tricks & Secrets page of this site.

QUERY
What is the DDE command key number that is used by XMP which allows a group of mp3 files (selected in Explorer) to be added to a currently playing track-list ?  This is the action performed by XMP when using the registry to handle the DDE command.  I have tried using the obvious candidates but cannot establish the correct command.

Dotpitch

  • Posts: 2871
Re: DDE Command Key Query
« Reply #1 on: 3 Aug '07 - 17:07 »
It works like this:
Code: [Select]
cmcdde xmplay system [list("filename.ogg")]I don't know whether it's possible to send multiple files in one command, but you could perform it for every file easily :).

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #2 on: 3 Aug '07 - 19:52 »
Dotpitch - thanks for your swift response.

When using the command string you suggested (at the command line) a message is returned "OK, completed successfully" but the file does not show up or start in XMP.

Before making the original post I found a list of key codes used by XMP (http://support.xmplay.com/article.php?id=17).  Using these I can successfully control the behaviour of XMP.

Examples:
cmcdde xmplay system key2     This minimizes XMP to the taskbar
cmcdde xmplay system key80   This starts to play a manually selected track
cmcdde xmplay system key2    This stops the currently playing track

What I cannot find is the key code which enables a file (specified on the command line or selected in Windows Explorer) to be passed to the XMP track-list.

Examples entered at the command line:
cmcdde xmplay system key6"filename.mp3"   This opens XMP's "Open File(s)" window but does not select the file
From the key codes guide "6 = Open files/URL"

cmcdde xmplay system key368"filename.mp3"  This opens XMP's "Open File(s)" window but does not select the file
From the key codes guide "6 = List files/URL"

Similar results are obtained when using Fast Explorer 2007 instead of the command line and substituting "%1" for filename.mp3 and selecting the file in Explorer.

If the XMP option to create the registry entry is enabled (Options and Stuff -> Integration -> Context Menu -> Add to XMPlay-list) it is possible to select a single or multiple files in Explorer and add them to a currently playing track-list.  This is done using DDE.  Does this use an unlisted key code?  Is the problem in the construction of the DD command ? Many variations have been tried without success.

Tsorovan

  • Posts: 1247
Re: DDE Command Key Query
« Reply #3 on: 3 Aug '07 - 20:36 »
cmcdde xmplay system [list("path_to_file")] works here. Are you supplying the full (and correct) path to the file?
The other console app I have (DDE_run.exe) also works.

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #4 on: 3 Aug '07 - 21:01 »
Thanks Tsorovan
Path to cmcdde.exe = F:\!Working\XMPlayDDE\cmcdde.exe
Path to test mp3 = F:\!Working\XMPlayDDE\Highway.mp3

Command issued = cmcdde xmplay system list"F:\!Working\XMPlayDDE\Highway.mp3"
Result = Message recieved "OK, completed successfully."
File does not appear or play in XMPlay.
?????

Tsorovan

  • Posts: 1247
Re: DDE Command Key Query
« Reply #5 on: 3 Aug '07 - 21:03 »
No. Verbatim. It NEEDS to be:

cmcdde xmplay system [list("F:\!Working\XMPlayDDE\Highway.mp3")]

brackets and parentheses included

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #6 on: 3 Aug '07 - 21:33 »
Thanks, that got it. The file(s) are now listed in XMP.

As files are added a command window opens and closes for each file in the list.  Is there any way to stop this?  A command line switch perhaps?

A second (and more important) issue.  Now that XMP is listing the files is it possible to make it mimic the actions it produces when registry enabled.  Specifically, pass a group of files selected by Explorer to XMP and start to play the first file in the list.  The group is selected and passed while XMP is not loaded and XMP begins whens the list is sent.

Using cmcdde and the list command does not produce this behaviour.

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #7 on: 4 Aug '07 - 10:50 »
After further searching of the forum archive it seems that DDE_run.exe might resolve the remaining issues.  Unfortunately I cannot locate a download site for it.  All searches point to Michael Polyakov's page (the author) http://www.angelfire.com/linux/myp/DDE_run/dde_run.html.  This gives a 404 error message.

Does anyone have a copy of DDE_run.exe (as mentioned in Tsorovan's post)?  If so please provide an address that it can be downloaded from.  Alternatively please drop me a private message so it can be done by email.
« Last Edit: 4 Aug '07 - 11:03 by SamK »

Tsorovan

  • Posts: 1247
Re: DDE Command Key Query
« Reply #8 on: 4 Aug '07 - 14:04 »
The source previously released didn't run properly in 2K/XP, so this is a fixed and recompiled version: http://gavle.to/~jfrisk/DDE_run.exe
« Last Edit: 4 Aug '07 - 14:08 by Tsorovan »

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #9 on: 7 Aug '07 - 08:20 »
Thanks Tsorovan,
I will post the outcome of my musings if I obtain anything worth posting.

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #10 on: 23 Aug '07 - 13:38 »
I have obtained some results I can happily live with – so here they are for anyone who might be interested.

The earlier successes reported above were achieved using static context menus created by Fast Explorer 2007.  Switching to dynamic context menu entries gives better results.
  • DDE commands are no longer required
  • Command windows no longer open for each file sent to XMPlay
  • XMPlay automatically restores from minimized-to-tray on sending files to it
  • Files can be added to a currently playing track list

Other Benefits Gained
  • XMPlay becomes more user friendly (in my view) as it corresponds more closely with my preferred manner of working with a PC
  • Relative paths from Fast Explorer to XMPlay are achievable
  • Context menu options are often not provided by portable applications as they are not installed on the host PC.  Fast Explorer provides this ability for portable applications (including XMPlay)
  • The solution is repeatable for other portable applications.  Each user is therefore able to construct their preferred context menu options and have them available on each PC they use
  • The solution is easy to use on different PCs.  A single tick-box in Fast Explorer applies and/or removes all user constructed context menu entries

EDIT - SEPTEMBER 03 2007 - SamK
After re-reading my post I felt it might be helpful to clarify that in order to gain all the benefits listed, each host PC must allow the user sufficient privileges to apply the user-created context menu entries to the local registry.
END OF EDIT

While this solution does not fulfil all the goals mentioned in my various threads in this forum, it certainly goes a long way towards meeting them.  My thanks go to each of the contributors who provided their time and expertise to help me (and possibly others) achieve a more enjoyable computing experience.
« Last Edit: 3 Sep '07 - 15:42 by SamK »

r

  • Posts: 188
Re: DDE Command Key Query
« Reply #11 on: 24 Aug '07 - 03:23 »
hey sam, would you mind posting your setup for fast explorer?

i'm interested... i just don't know where to start!

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #12 on: 24 Aug '07 - 16:00 »
djray – I'm not quite sure what you need so here is my best guess to get you started.  It is more complicated to read than it is to do.

ASSUMPTIONS
The following examples use drive letter C:.  If you use your portable applications from an external USB device, the drive letter on your PC may of course be different.
Mp3 files are used as examples.  Your preferred file-type may be substituted.

PREPARATION
Once you have obtained your portable applications unpack them into a common folder structure.  e.g.
      C:\PortableApps\FastExplorer
      C:\PortableApps\XMPlay
      
There are many benefits to this approach but in this context it allows for relative paths to be easily used by Fast Explorer.


CONFIGURE XMPLAY
Set up XMPlay to work in the manner you prefer e.g.
      Skin,  On top,  Always in tray,  Auto advance,  Add tracks to list by default

If you are attempting to keep the registry entries to a minimum, and maximize portability, avoid any settings within XMPlay which create optional registry settings such as those shown in Options and stuff -> Integration -> Context menu.


CONFIGURE FAST EXPLORER
Set up Fast Explorer 2007 to create the required context menu entries.
      Select Submenu Items -> Item -> Add Item
      Browse to C:\PortableApps\XMPlay\xmplay.exe 

In Item Details delete the Drive letter and colon to create a relative path to Xmplay.exe e.g.
      \PortableApps\XMPlay\xmplay.exe

In Item Details use the drop-down arrow to change the File Type from  All Files to “MP3 Format Sound”.  This will automatically change Key to “mp3file” and Extensions to “.mp3”

In Item Details make ensure Active is ticked

In Menu Items rename MP3 Format Sound\XMPlay  to “MP3 Format Sound\Queue in XMPlay”.  “Queue in XMPlay” is what will be shown in the context menu.

Apply the settings


IN USE
When using on multiple PCs, start Fast Explorer and In Menu Items ensure Enable Dynamic Options is ticked.  This applies all the user constructed context menu items.  Similarly un-tick this box at the end of your session and they will all be removed from the host PC.

Use Explorer or your preferred file-manager to highlight and select a group of music files.  Right click the mouse to bring up the context menu and select Queue in XMPlay.  When XMPlay is displayed, click the play button and enjoy the results of your work.

FINALLY
Many users of portable applications employ a portable applications menu program.  Due to its simplicity and minimalistic approach, my preference is for PStart (http://www.pegtop.net)
« Last Edit: 24 Aug '07 - 18:29 by SamK »

r

  • Posts: 188
Re: DDE Command Key Query
« Reply #13 on: 25 Aug '07 - 22:25 »
Hi Sam,

Thanks for the detailed instructions!

Fast Explorer doesn't have any help files of any kind, so this helps a lot!

One thing that would be nice in Fast Explorer is the ability to add more file types for just the one context menu entry (unless i'm overlooking something in FE?).

Say I wanted to add a DVD Audio file (.AC3) for XMPlay... i would have to repeat the process i did for adding an MP3 context entry, wouldn't i?  And also .AC3 would have to be a registered file type under Windows Explorer in order for FE to detect it in the file type drop down...

oh and FYI, i also prefer minimalism!
i use uStart (http://www.portablefreeware.com/?id=1017) as my portable apps launcher.

SamK

  • Posts: 32
Re: DDE Command Key Query
« Reply #14 on: 26 Aug '07 - 11:55 »
Thanks for the detailed instructions!
You are very welcome.  Worked examples are always helpful in my view.  As far as XMP and FE are concerned I have no particular expertise to offer as I am simply an interested end user of these products.


Fast Explorer doesn't have any help files of any kind, so this helps a lot!
Quote from FE readme.txt - “Why there is no help for the application?
It's here : press F1 in any place of the Fast Explorer to get quick hint.
You may also refer to the Fast Explorer web site for additional information:
http://thesoftpro.tripod.com/fe



One thing that would be nice in Fast Explorer is the ability to add more file types for just the one context menu entry (unless i'm overlooking something in FE?).
...would have to be a registered file type under Windows Explorer in order for FE to detect it in the file type drop down...
Due to my music library being entirely in mp3 format my example/solution is designed to produce the action I require based on file-type. In fact, I used FE to create a context sub-menu structure entitled “PORTABLE ACTIONS” and then placed “Queue in XMPlay” within this structure.  This simply makes the context menu options easier to find when using different PCs, but also indicates that the choice is action based rather than application based.

Where I wanted the context menu options to be application based a different approach was adopted.  FE was used to create a context sub-menu structure entitled “PORTABLE APPLICATIONS”.  Within this structure are placed context menu options to start a range of applications with the selected file.   This is achieved by using File Type “All Files” and Key “*.*” for each entry.  This enables FE context menus to be used without a particular/specific file-type being registered on the host PC.

Together these solutions cover the range of options I require.  One benefit of this approach is that a repeatable solution, suited to each individual user, might be possible.  The answer to your requirements might be quite different from mine.  There is a file-type option offered by FE “Non associated files” which might be helpful. 

Enjoy your experiments.