Hi Joakim,
you can use the pbm_customXX events to receive and process custom messages from other applications. pbm_custom01 maps to WM_USER (=1024), pbm_custom02 is WM_USER+1 etc. So you can have your C# app send a WM_USER message to your main PB window and map an event to pbm_custom01 there.
Note that the PB help file lists this as an "obsolete technique". For sending messages within the same PB app I'd agree but as far as I know there's no alternative for processing custom messages from other applications.
For that C# implementation that you describe above, the key SDK call would be to use the FindWindowW() O/S command to locate the PB Window class in memory. Then your App can use the SDK Send() command for those PBM_xxx custom events.
FYI: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-findwindoww
You could also use DDE: from C#: http://chrispollach.blogspot.com/2023/04/dde.html
You could also use TCP/IP from C#: http://chrispollach.blogspot.com/2023/04/socket.html
HTH ;-)
Regards ... Chris