Okay, if the form is a xaml file then it is WPF.
What is Hwnd
? Process.GetCurrentProcess().MainWindowHandle
is an IntPtr
but your code does not show the definition of Hwnd
. That is probably not important to the problem but I am not sure.
What is parameters
? What type is it? a HwndSource
can be created using a System.Windows.Interop.HwndSourceParameters
but they do not have a ParentWindow
member.
What is view
? I see no declaration of it.
Note that the code you show here does not use src
. So most of the code is not relevant.
Do you know what the value of handle
is?
Also, you do not tell us where the code is at in the application. If the code executes before the main window is created then of course there is no handle.