connectTwoprogram.zip
ProgramA.au3
#Include <WinAPI.au3>
#Include <SendMessage.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $ConnectOK = 99999 , $iGuiHwnd = 0 , $ConnectHWnd , $ConnectMsg
$GuiHwnd = GUICreate("ProgramA", 199, 147, 88, 177)
$Button1 = GUICtrlCreateButton("GetConnectHWnd", 16, 16, 169, 33, $WS_GROUP)
$Button2 = GUICtrlCreateButton("SendMessage", 13, 69, 169, 33, $WS_GROUP)
$ConnectMsg