I need to create a dll which manages some IP Bluetooth low-energy device on Windows 8.1 / 10.
My first challenge is to be able to intercept connection/disconnection events. I managed to achieve this by following MSDN's instructions for registering Bluetooth device notifications, and by following the Registering for Device Notifications example. The result is a working console app.
Next, I wish to wrap this in a DLL, and have a dedicated thread pump the message-only window's messages. Questions:
it this a reasonable solution, or am I better off using the calling thread to pump messages for this Window (which is obviously not single nor main)?
if this is the way to go, how do I create a thread that pumps messages for a specific Window?
can I simply rely on Thread Affinity, create the message-only Window in a new thread, and they will be coupled happily ever after?