.NET Core Message Pump

I'm writing a cross-platform mouse without borders clone right now. Basically a .NET version of Synergy. 

Tech stack: .NET Core, SignalR

I ran into an issue with my windows hooks not working when running inside a .NET Core console. This is because if you don't include Application.Run(new ApplicationContext()), there is no Windows message pump. Without a message pump, your hooks won't receive anything.

 Fortunately, you can implement your own message pump very easily.

More...

At the bottom of your console app, you need to implement a message pump by calling into the native windows API function: GetMessage, TranslateMessage, and DispatchMessage.

And then in at the bottom of you console app - write the pump

Michael

I'm a software developer and consultant living in Cary, North Carolina. I work for a small consulting firm based out of Clemmons, North Carolina. We have clients all over the state. I've had amazing opportunities to work with different technologies and business problems since getting started in 2009. My goals for this site are simply to share interesting things I run into or do.