Hi Thomas,<div><br></div><div>Thanks for your email. Yes - I tried that - actually, I used Spy++, which seems to be the new version. This gave some useful information, but not the actual command string. </div><div><br></div>
<div>I have pasted below the results for three different operations in Lua and in Python - the third one is the one that is not working.<br>
<br>======================================================</div><div>1) When the Lua script manager connects to Ecotect, I see this DDE message:</div><div><br></div><div><div><div><00001> 0039054A S WM_DDE_INITIATE hwnd:002404F2 aApp:C07F ("Ecotect") aTopic:C0A2 ("request") [wParam:002404F2 lParam:C0A2C07F]</div>
<div><00002> 0039054A R WM_DDE_INITIATE lResult:00000000</div></div><div>... repeated lots of times</div><div><div><00241> 002404F2 S WM_DDE_ACK hwnd:000E0508 aApp:C07F ("Ecotect") aTopic:C0A2 ("request") [wParam:000E0508 lParam:C0A2C07F]</div>
<div><00242> 002404F2 R WM_DDE_ACK lResult:00000000</div><div><00243> 001404BE R WM_DDE_INITIATE lResult:00000000</div></div><div><br></div><div>In Python I do this (which works fine):</div><div><br></div><div>
<div>import win32ui</div><div>import dde</div><div>server = dde.CreateServer()</div><div>server.Create("TestClient")</div><div>conversation = dde.CreateConversation(server)</div><div>conversation.ConnectTo("Ecotect", "request")</div>
</div><div><br></div><div>And I get the almost the same DDE message:</div><div><br></div><div><div><00001> 001805CC S WM_DDE_INITIATE hwnd:00110750 aApp:C07F ("Ecotect") aTopic:C0A1 ("request") [wParam:00110750 lParam:C0A1C07F]</div>
<div><00002> 001805CC R WM_DDE_INITIATE lResult:00000000</div><div>... repeated lots of times</div><div><div><00281> 00110750 S WM_DDE_ACK hwnd:000E0508 aApp:C07F ("Ecotect") aTopic:C0A1 ("request") [wParam:000E0508 lParam:C0A1C07F]</div>
<div><00282> 00110750 R WM_DDE_ACK lResult:00000000</div><div><00283> 001404BE R WM_DDE_INITIATE lResult:00000000</div></div></div><div><br></div><div>======================================================</div>
<div>2) When Lua sends the command cmd("new.model"), I see the DDE message:</div>
<div><br></div><div><div><div><div><00304> 002C0474 P WM_DDE_EXECUTE hwnd:00230542 lPackedVal:01A304EC hCommands:01A304EC [wParam:00230542 lParam:01A304EC]</div><div><00305> 00230542 P WM_DDE_ACK hwnd:002C0474 lPackedVal:001C3668 wStatus:0000 aItem:3668 ("#13928") [wParam:002C0474 lParam:001C3668]</div>
<div><00306> 002C0474 P WM_DDE_EXECUTE hwnd:00230542 lPackedVal:01A304EC hCommands:01A304EC [wParam:00230542 lParam:01A304EC]</div><div><00307> 00230542 P WM_DDE_ACK hwnd:002C0474 lPackedVal:002000B0 wStatus:0000 aItem:00B0 ("#176") [wParam:002C0474 lParam:002000B0]</div>
</div></div><div><br></div><div>In Python I do this (which also works fine):</div><div><br></div><div>conversation.Exec("model.new")</div><div><br></div><div>And I get the almost the same DDE message:</div><div>
<br></div><div><div><00232> 00340408 P WM_DDE_EXECUTE hwnd:001C0494 lPackedVal:01A304EC hCommands:01A304EC [wParam:001C0494 lParam:01A304EC]</div><div><00233> 001C0494 P WM_DDE_ACK hwnd:00340408 lPackedVal:00239698 wStatus:0000 aItem:9698 ("#38552") [wParam:00340408 lParam:00239698]</div>
<div><br></div></div><div>======================================================</div><div>3) When Lua sends the command get("app.computer"), I see the DDE message:</div>
</div><div><br></div><div><div><div><div><00312> 002E0474 P WM_DDE_EXECUTE hwnd:002B042E lPackedVal:01A304EC hCommands:01A304EC [wParam:002B042E lParam:01A304EC]</div><div><00313> 002B042E P WM_DDE_ACK hwnd:002E0474 lPackedVal:001A8B60 wStatus:0000 aItem:8B60 ("#35680") [wParam:002E0474 lParam:001A8B60]</div>
<div><00314> 002E0474 P WM_DDE_EXECUTE hwnd:002B042E lPackedVal:01A304EC hCommands:01A304EC [wParam:002B042E lParam:01A304EC]</div><div><00315> 002B042E P WM_DDE_ACK hwnd:002E0474 lPackedVal:001C33A8 wStatus:0000 aItem:33A8 ("#13224") [wParam:002E0474 lParam:001C33A8]</div>
</div></div><div><br></div><div><div>The documentation for the Lua get() command says the following:</div><div>"get() Prepends 'get.' to the front of a command string, sends it to Ecotect and formats results into variables. Used for retrieving object properties."</div>
</div><div><div><br></div><div>So in Python I also perpend "get." to the front of the string (but it does _NOT_ work):</div><div><br></div><div>conversation.Exec("get.app.computer")</div><div><br></div>
<div>And I get this DDE message:</div></div><div><br></div><div><div><00234> 00340408 P WM_DDE_EXECUTE hwnd:001C0494 lPackedVal:01A304EC hCommands:01A304EC [wParam:001C0494 lParam:01A304EC]</div><div><00235> 001C0494 P WM_DDE_ACK hwnd:00340408 lPackedVal:00236F28 wStatus:0000 aItem:6F28 ("#28456") [wParam:00340408 lParam:00236F28]</div>
</div><div><br></div><div>======================================================</div><div><br></div><div>I have tried a huge number of variants of this string - "get app.computer", "get(app.computer)", "app.computer.get" etc etc- , but no luck. </div>
<div>From the DDE documentation, I know the command string that Lua sends to Ecotect is stored in hCommands, but I can't figure out how to see this string...</div><div><br></div><div>Any suggestions?</div><div><br></div>
<div>Patrick</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><div><div class="gmail_quote">
2009/6/19 Thomas Heller <span dir="ltr"><<a href="mailto:theller@ctypes.org" target="_blank">theller@ctypes.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Patrick Janssen schrieb:<br>
<div>> Hi all,<br>
> I am having some trouble with controlling a Windows application through dde<br>
</div>[...]<br>
<div>> Does anyone know how I might be able to see the dde command strings that Lua<br>
> is sending to Ecotect (which all seem to work - I am thinking that there may<br>
> be an error in the documentation).<br>
<br>
</div>The old DDESpy tool comes to mind.<br>
<font color="#888888"><br>
--<br>
Thanks,<br>
Thomas<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
</font></blockquote></div><br></div>