I am trying to find the handle of a VB.Net WPF application. I have tried various hWnd IntPtr commands with no luck
Me.Handle gives the error 'Handle' is not a parameter of MainWindow
Dim itnrp As IntPtr = Process.GetCurrentProcess().MainWindowHandle
gives the error:
error BC30657: 'ToPointer' has a return type that is not supported or parameter types that are not supported.
If I try putting it into a function to try and get the type that the above error appears to refer to like this...:
Public Function GetHandleOfWindow()
winHandle = Process.GetCurrentProcess().MainWindowHandle.GetType()
'Return winHandle
End Function
I get the same error BC30657 as previous
If I try:
Public winHandle As IntPtr
winHandle = New WindowInteropHelper(Me).Handle
I get the same error BC30657 as previous
Any help would be much appreciated!!