How can i add window message?

Check out this GitHub commit for the new API that allows you to intercept Windows messages. I haven’t tested it yet, but it should work. Implement the IWindowsMessageHandler interface and register it with FWindowsApplication::AddMessageHandler(). Don’t forget to remove it when you don’t need it anymore. Also note that this is only for Windows, so you should only use it in code that is wrapped in #if PLATFORM_WINDOWS.

Example:

#if PLATFORM_WINDOWS
    class FMyWindowsMessageHandler
        : public IWindowsMessageHandler
    {
        public:
            virtual bool ProcessMessage(HWND hwnd, uint32 msg, WPARAM wParam, LPARAM lParam, int32& OutResult) override
            {
                // Handle your messages here
            }
    }
#endif


#if PLATFORM_WINDOWS
    TSharedPtr<GenericApplication> GenericApplication = FSlateApplication::Get().GetPlatformApplication();
    FWindowsApplication* WindowsApplication = (FWindowsApplication*)GenericApplication.Get();
    WindowsApplication->AddMessageHandler(MyMessageHandler);
    //...
    WindowsApplication->RemoveMessageHandler(MyMessageHandler);
#endif