I figured out how to send the message with data, but i couldn't understand how to read it in the 'receiver app'
// Sender
void Msg(std::string msg)
{
// Remove non utf8 char from string.
string = sanitize_utf8(string);
COPYDATASTRUCT cds{};
cds.dwData = 1;
cds.lpData = (PVOID) string.c_str();
cds.cbData = strlen((char*)cds.lpData);
auto response = SendMessage(hwnd, WM_COPYDATA, (WPARAM)w_hwnd, (LPARAM)&cds);
}
While searching I could find some examples, but i still did not understand how to properly write it.
The receiver is a dll lib.
//Received
//??
I dont know much about c++, would like to ask if someone could explain me it with most details possible.