Never mind, I found it out with the code sample in this thread. I was listening to the wrong message, should have used WM_COMMAND.