Background Message Interception Using Windows Hooks: A Practical Example

One of my favorite hobbies is playing computer games and streaming the gameplay using a web platform such as Amazon’s Twitch. I know, I know, it’s not very exciting to have a hobby related to computers if you already have to work with them on a daily basis, but believe it or not, streaming gameplays is actually a rising trend, with the most popular Twitch channels reporting millions of followers and views.
This trend has achieved such popularity that even Google is improving the YouTube platform to increase its streaming capabilities.

Usually, streamers like to play random sounds to enrich the experience for their viewers. For instance I love playing the infamous “toasty” clip from Mortal Kombat 2 whenever I kill another player in a game that has nothing to do with Mortal Kombat.

Of course, manually playing the sounds using a media player can be a very demanding task for someone who has both their hands already occupied playing a computer game. But how about we build a program that automatically plays the sounds we want whenever we press a key?

Continue Reading