Dynamic Data Exchange and the Holy Grail...

Products and tips

Moderator: Site Mods

Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Dynamic Data Exchange and the Holy Grail...

Post by Kilmatead »

As I've been having a tremendous amount of fun recently (well, fun for an introverted hermit) modifying the context menu on a per-filetype basis, I've pretty much grasped the concepts involved insofar as extensions relate to each other solo or in filetype groups.

However, the finer points (or even basics) of DDE (Dynamic Data Exchange) elude me.

To this end, there are two (free) utilities which facilitate this: FileTypesMan and Default Programs Editor - they both do effectively the same thing, but the former is more specialised (and slightly more flexible in its milieu), while the latter is far more stylised, user-friendly, and integrates wonderfully into Windows via Control Panel (a special note of thanks to user atitlan for recommending this one :D - should be installed on all machines by default).

As far as DDE is concerned they both allow options to it which look like this:

In FileTypesMan:

Image

And in Default Programs Editor:

Image

In essence, if someone could give me an example of how to (and why to) use the fields:
  • "Message"
    "Application"
    "Ifexec" ("Use DelegateExecute"?)
    "Topic"
    "Use Droptarget"
...and what they do, I would appreciate it.  Even just a single example would allow me to divine more or less what I want to know.

Hopefully someone out there in the aether understands such stuff (I've spent a lot of time reading the DDE link at the top of this post, but they don't seem to provide examples or a simple layman's look into each aspect, making it difficult for me to grasp; they seem to spend more time saying "COM == Bad" and "DDE == Good" than anything else).

Anyway, I'd appreciate any insight offered.  Cheers.
User avatar
nikos
Site Admin
Site Admin
Posts: 15794
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

dde is a relic of windows 3.1 which i never bothered to read about
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

It's lonely in the dark.  :cry:

I figured you were the last best hope of humanity.

:shrug:

Should I take up basket-weaving instead?
User avatar
nikos
Site Admin
Site Admin
Posts: 15794
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

dde is an 'exchange' between two processes in human language sounding messages (strings). That's all about it from me, more from wikipedia!
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Although your initial link leads to reference that suggests netDDE may be dieing off, from what I've read it appears that DDE is alive and well in the windoze shells for apps to use for Inter Process Communication.
Here's a tip the iceberg reference in msdn.
As an end user I'm not bored enough to delve into the details. :shrug:
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Ok (preparing to cogitate whilst rolling a cigarette), DDE seems to relate to a lot of very specific things in a general way - my original query is all based from file extensions and exactly how Windows calls them during (shell) contextual invokations.

In a general sense as to "why" someone might use it (for those interested) it can be used to "silently" open and control an application - common examples relate to what/how the generic (on the surface) "Print" command you see populating shell menus works.  (For instance whether Word or Notepad or OpenOffice is invoked for any particular document, when printing "invisibly" and how it's called.)  Printing is actually the least it can do, but other examples get ridiculously complex for this post.

None too coincidentally I'm beginning to suspect this can also be related to x2's habit of opening Help Links in IE vs FF.  That thread was centred upon how windows defines its default browser, but I get the feeling it's in the core reference to the help-source itself, programmatically.  (Nikos may sputter at this, but a recent investigation into "explorer replacement" and how x2 doesn't handle the Start Menu very well seems DDE related within the menu's application groups.  I was just reading about this "somewhere" but I lost the link not thinking it important at the time, so details remain fuzzy.  Much involves the interplay of a program and its document: CALL ui.Interface.frontCall ("WINDDE","DDEExecute", [ program, document, command ], [result]), from here.)

In any event, I did find definitions for the terms I was pursuing.

Forsooth, seeth here as the following:
  • Command: The value is the command line to start the associated application. "%1" is the file path to open.  The application is usually the same for all the Verbs, but it need not be.

    Ddeexec: The value is the default DDE Execute command string. It usually has an Application sub-key and a Topic sub-key. If there is no Ifexec sub-key, this string is used whether or not the application had to be started. If the Ifexec key is present, the Ddeexec command is used only if the application is already running.

    Ifexec: The value is the DDE Execute string sent to the application just after it has been started. If this key is absent, the default Ddeexec value is sent instead.

    Application: The DDE service name for the Shell to connect to for sending DDE Execute commands. This is frequently the same as the application name, for example "Excel" and "IExplore". Usually present if there are any DDE Execute strings for the Verb, if not Windows uses the executable name.

    Topic: The DDE Topic name for the Shell to connect to for sending DDE Execute commands. Defaults to "System" if this key is absent.
So what of it for the common man?  At first I was beginning to feel I was a morbid dog barking up a tree from hell - all "real world" examples I ran across involved using Excel to monitor stock-market issues real-time.  (Like the Gods care anymore what those self-absorbed idiots do.)  Interestingly, lots of details involve DDE packets of so-called "atoms" (which are strewn throughout the Windows cosmology - but that's another metaphor :wink:.)

As fgagnon references in his link, these atoms revolve through the nucleus of 'Notifications' (WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, WM_DDE_INITIATE, and so on).  These relate to DDE "aware" applications, as opposed to my focussing on shell menu commands.

Now I just feel I'm just a blithe little dog barking up a tree of fine-tuning minutiae.

In essence, the shell context applications mentioned in the first post are quite sufficient in their defaults for most modifications people would want to do.  It's quite easy once you get the hang of it and well worth experimenting with.

However, as far as DDE is concerned for the real-world, the cigarette is burning... burning... gone. :sleep:

* * *
fgagnon wrote:As an end user I'm not bored enough to delve into the details.
Fred, you know only too well what happens when I get bored.  One of many of God's curses, and I utilise it to curse him right back, as Caliban and Rimbaud would be my guides in hell. :D

Image
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Kilmatead wrote:you know only too well what happens when I get bored.
... of course ;) --
which is exactly why I baited you with "... I'm not bored enough ..."  [emphasis added]
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Anyone happen to know why static context menu additions (those not implemented via DLL) under the usual HKCR\Software\Classes key will mysteriously vanish if more than 15 files (all same type) are selected?

This affects both x2 and WE so it's not a bug per se, just an anomaly.  Is this a Windows thing, an NTFS/FAT32 thing, or limited to Win7?  Not having XP I can't check.

Curious.  (x2 User Commands, etc, all work fine with however many files one cares to select, it's only via context menu.  Applies to photos, musics, PDFs, whathaveyou.)

<= 15 is fine, 15 + <x> is off with the fairies. :?
Cosmo
Gold Member
Gold Member
Posts: 465
Joined: 2007 Apr 17, 11:09

Post by Cosmo »

I don't see the problem here on XP SP3 32 Bit with NTFS volumes.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Cosmo wrote:I don't see the problem here on XP SP3 32 Bit with NTFS volumes.
Thanks for checking... and the answer appears to be (according to this) that this is another inexplicable "since Vista" change that MS decided to do, so it doesn't apply to XP.

According to "Zack Robinson, a Microsoft senior developer",
...the definitive differential in the file opening experience is based upon the application's shell association type. Legacy handlers are limited to 15 selections by default for performance reasons. Applications using modern shell association methods will not have this limitation.
Vista/Win7 does not actually check to see if the application in question is "legacy" or not (unless it's a registered DLL, which is why some work), it simply removes access to all static context handlers at 15+ files, regardless.  How rude.

As most applications these days have no problem opening numerous files (even though at times their own "File Open" interface makes it difficult) the use of User Commands circumvents this issue, conveniently, as apparently there's no practicable limit to $S and Vista/Win7 doesn't actually limit the number of Selections, simply the filetype extension links themselves.

This is, de facto, the same thing that happens when you select more than one filetype at a time - windows won't simply open them all in their associated applications and trashes their filetype handlers collectively.  For this, the workaround in the above link is actually useful, if you work on projects that require opening multiple filetypes in different programs at the same time.

To do this as a user command you'd have to write a script to open each file in the list - which the above script does - except it doesn't work in x2 as a UC.

Which begs the question, Nikos, why can't I seem to pass $-token arguments to a VBS file in a User Command?
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Kilmatead wrote:...why can't I seem to pass $-token arguments to a VBS file in a User Command?
Answer: Because I'm an idiot. :oops:

Code: Select all

> "C:\Windows\System32\wscript.exe" "[...].vbs" $S
Not that anyone cared to mention this or anything.  Why am I always the last to find out the entertaining stuff?  Or is this one of those philosophical things where "Hard Earned in Solitude is Properly Learned"?

There was once a petite brunette who tried to teach me that lesson.  I wasn't a happy bunny.  :heartbroke: :roll:
pj
Gold Member
Gold Member
Posts: 475
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

As the say in the textbooks, "...the exercise is left for the student".

Grasshopper, seek the path to happiness and enlightenment through elegant scripting.

-----------------
(Humbly) PJ in (sunny) FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

pj wrote:Grasshopper, seek the path to happiness and enlightenment through elegant scripting.
This particular locust is more a matter of grievous bodily harm,  blunt force trauma, and Rock-'em Sock-'em Robots.

Schubert is about elegance.  Scripting is akin to Schoenberg's 12-tone polychromality.

Not being a big fan of bugs or creepy-crawlies in general, what's the deal with this evil thing in your Everglades?  They grow 4-5 inches long?  That's just not right.
pj
Gold Member
Gold Member
Posts: 475
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

To borrow a phrase from Crocodile Dundee: "That's not a grasshopper, now this is a grasshopper" http://ez-upload.net/nouser/IMG_0866-7700.JPG in my backyard.

But, we have to have something to feed these besides the handy poodle: http://www.wftv.com/news/23013238/detail.html

------------------
PJ in (wary) FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

pj wrote:PJ in (wary) FL
:D

And let's hear it for 10MP cameras.  Darwin would have loved your neck of the woods.

Image

The same God that designed your backyard friend's foot must have also been in charge of contextual DDE.

St. Patrick, bless his fictional soul, ensured that Ireland is not only a snake-free, but locust-icky-thingy-free zone as well, thank the Gods. :wink:
Post Reply