How can i add window message?

I updated the answer with example code. MyMessageHandler is assumed to be of type FMyWindowsMessageHandler, which is a class you need to implement.