I am creating a C# WPF exe and a C# DLL. There is a function called StartRecording in DLL. The exe calls this function. The function installs Low-level mouse and keyboard hooks on a third party application (e.g. MS Word). Inside the hook procedures, I collect details related to the mouse/keyboard message and also the details of the control (using UI Automation) with which the user interacts.
I want to send a notification from the DLL to the exe that data have been collected and in the notification itself, I want to send the data. What is the best way to do this? One option, I can think of is to send WM_COPY_DATA message from the dll to the exe. But is there any better way? Is there a way by which I can send a Dictionary from the dll to the exe?