proc main string pathname integer pwhwnd1, pwhwnd2 long pwchanid1, pwchanid2 pathname = $pwtaskpath ;Get Procomm's path. addfilename pathname "PW5.EXE" ;Add Procomm's EXE. if run pathname ;Run the program. pause 5 pwhwnd1 = $mainwin ;Get the active window ID. if run pathname pause 5 pwhwnd2 = $mainwin if ddeinit pwchanid1 "PW5" "System" pwhwnd1 ;Establish DDE connection with first instance. ddeexecute pwchanid1 "EXECUTE HINTS.WAX" else errormsg "Error initializing DDE channel" endif if ddeinit pwchanid2 "PW5" "System" pwhwnd2 ;Establish DDE connection with second instance. ddeexecute pwchanid2 "EXECUTE HOSTUTIL.WAX" else errormsg "Error initializing DDE channel" endif endif else ;Problems running program. errormsg "Error running %s" pathname endif endproc