That depends on what window handle you provided to the OS. You can subclass the widget you used and overwrite the message handler, and then look for your message.