Page 1 of 1

DDE INSERT FORMAT for an AutoComplete tool

Posted: Fri Mar 14, 2008 3:12 am
by elrond
I am working in an auto-complete tool for Textpad, and I am having problems running the command that inserts a text from my application in the current position of the current document in TextPad.

There is c# function that executes the commands.

(lets assume that the DDE connection has been started properly and so forth)

client.Execute(string command, int timeout)

My question would be: Which is the correct format for the command string.

I have unsuccessfully tried:
"[command(Insert,Hello World)]" (from Texpad documentation)
"Insert,Hello World"
"command(Insert,Hello World)"

thank you in advance

Posted: Sat Mar 22, 2008 5:18 am
by drefty
Here is an example using perl that I wrote a few years ago after struggling to get Textpad DDE Insert to actually work.
[code]
### These commands must be passed exactly as shown, with no embedded spaces, except in the quotes.
###

use Win32::DDE::Client;
$oTPad = new Win32::DDE::Client('TextPad', 'System');
$sTest = "Hello World\n" x 5;
$oTPad ->Execute('[command(Insert,"'.$sTest.'")]');
[/code]

==== Personal opinion
Please note, that you may be disappointed by the limitations of DDE insert, as it doesn't work very elegantly with the TextPad edit area and cursor. Also, you may notice a few odd quirks, such as the inability to replace the currently selected text with the value of your DDE insert.