You're describing DDE. In use since Windows 2.0 and still functioning today in Windows 10, 32 years later.
https://en.wikipedia.org/wiki/Dynamic_Data_Exchange
https://docs.microsoft.com/en-us/windows/desktop/dataxchg/dy...
It's implemented with the WM_DDE_... series of messages. There's a library, DDEML, which wraps some of the complexities.