I'm working with DirectShow in firemonkey, and i have a problem with outputting Video.
iVideoWindow.Put_Owner(Panel1.Handle);
I need handle of TPanel, to display video at it. But FMX controls have no handle. I know, that Firemonkey is not based on traditional windows and FMX do not provide this, but how to solve this problem? I have no idea, please, help me.
If you want to get a window handle as an HWND (windows api) type, you can now call this function:
WindowHandleToPlatform(form1.Handle).wnd
Put in your uses section:
uses
FMX.Platform.Win;
Note that just calling WindowHandleToPlatform(form1.Handle) will not work, you have to access .wnd to obtain the winapi handle.
Since this makes an application less portable, it is also a good idea to put {$IFDEF MSWINDOWS} whenever doing this, and if you ever port to MacOS, you'll have to write code for that platform. Or put this code into a separate unit that deals with MS Windows related code only, and IFDEF the unit into your uses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With