[comp.windows.ms] DOS app <-> Windows app communication

u2zj@vax5.cit.cornell.edu (Stanton Loh) (11/14/90)

A windows programmer friend asked me to post this:

Microsoft Windows 3.0
---------------------

What I need to be able to do is run a DOS program in a DOS
window that communicates with my Windows program.  Data needs to
flow both ways.  I tried putting data in a file, and having both
programs check for the existence of the file, but my Windows DLL
made the disk thrash horribly while checking for the existence
of 4 files, due I suspect to Windows making all processes update
a directory before reading it.  The Bridge program sends
keystrokes to applications, so I know it can be done.  I tried
using EnumWindows to get the hWnd for the DOS session, then
sending it keystroke messages, but that did nothing (or beeped).
- Doug Stauffer

Thanks for any help,
==============================================================
|Stanton Loh               | u2zj@vax5.cit.cornell.edu       |
|Baker Lab, Cornell Univ   | u2zj@crnlvax5.BITNET            |
|Ithaca, NY 14853-1301     | stanton@chemres.tn.cornell.edu  |
==============================================================

spolsky-joel@cs.yale.edu (Joel Spolsky) (11/14/90)

In article <1990Nov13.210047.984@vax5.cit.cornell.edu> u2zj@vax5.cit.cornell.edu (Stanton Loh) writes:
>Microsoft Windows 3.0
>---------------------
>
>What I need to be able to do is run a DOS program in a DOS
>window that communicates with my Windows program.  Data needs to
>flow both ways.  


Hi, 

There is a Microsoft document calls "Old Application DDE Interface." I
know that it came with the 2.0 SDK. If this document is not in the 3.0
SDK, you should be able to call microsoft and ask for it. Quoting from
the introduction:

	"The WinOldAp Dynamic Data Exchange (DDE) allows a Microsoft
	Windows application ... to manipulate an old DOS program in 
	the same manner as a user would under Windows."

It is designed to make it easy to write windows shells with menus and
stuff for old DOS applications.

There are also functions that old applications (DOS applications) use
the clipboard; they are accessed through interrupt 0x2F. This is also
well documented in the 2.0 SDK.

Joel Spolsky
spolsky@cs.yale.edu                                     Silence = Death

hadgraft@civeng.monash.edu.au (Roger Hadgraft) (11/15/90)

In article <27266@cs.yale.edu>, spolsky-joel@cs.yale.edu (Joel Spolsky) writes:
> In article <1990Nov13.210047.984@vax5.cit.cornell.edu> u2zj@vax5.cit.cornell.edu (Stanton Loh) writes:
>>Microsoft Windows 3.0
>>---------------------
>>
>>What I need to be able to do is run a DOS program in a DOS
>>window that communicates with my Windows program.  Data needs to
>>flow both ways.
>
>
> Hi,
>
> There is a Microsoft document calls "Old Application DDE Interface." I
> know that it came with the 2.0 SDK. If this document is not in the 3.0
> SDK, you should be able to call microsoft and ask for it. Quoting from
> the introduction:
>
>       "The WinOldAp Dynamic Data Exchange (DDE) allows a Microsoft
>       Windows application ... to manipulate an old DOS program in
>       the same manner as a user would under Windows."
>
> It is designed to make it easy to write windows shells with menus and
> stuff for old DOS applications.
>
> There are also functions that old applications (DOS applications) use
> the clipboard; they are accessed through interrupt 0x2F. This is also
> well documented in the 2.0 SDK.
>
I wrote an application that used all the neat features that were built in by
Microsoft. Unfortunately, when Win/386 was released, MS decided that they'd drop
the capability. I haven't checked, but I'd be most surprised if the facility was
still in Win 3. It's a pity, because it was possible with Win/286 to add a menu
bar and macros to DOS applications, turning them into pseudo-Windows
applications.

I've developed that program in a different direction. It now runs
independently of DOS and Window applications, but it can send keystroke
sequences to them, and do other things (like instruct them to Copy and Paste). I
use it with a couple of DOS applications, and with my Windows communications
program to store VAX commands. It sure makes talking to a host computer much
easier.
>
--
Roger Hadgraft                  |  hadgraft@civeng.monash.edu.au
Lecturer in Civil Engineering   |
Monash University               |  phone:  +61 3 565 4983
Clayton, Vic. 3168. Australia.  |  fax:    +61 3 565 4944 or 3409