I am trying to create a hidden window to receive messages

This is not an UNREAL window, but a window created using win API.
CreateWindowEx (Low level Windows API function)

When building project, the function that uses “CreateWindowEx” function gets totally optimized out. I can set a break point in code before it, but a breakpoint inside the function that calls "CreateWindowEx " is hollow. The function never gets called.

I am using DirectShow, to stream various video sources inside UE5.2 app.
One thing I needed to do was to be able to receive notifications of end of video streams. Well one method was to create a hidden window to receive these notifications.
But as I said, the function seems to be optimized out and not compiled.