S
Shayne H
I am trying to convert the following to VB.NET code
Type t = notifyIcon1.GetType()
IntPtr window =
((NativeWindow)t.GetField("window",System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.NonPublic).GetValue(notifyIcon1)).Handle;
As I understand it, the fragment:
window = ((NativeWindow)t.GetField(...
is casting an object of type System.Reflection.FieldInfo to NativeWindow
Am I interpreting that correctly?
I do not seem able to make the necessary conversion in VB.NET
This is as far as I've got:
Dim typ as Type = notifyIcon1.GetType()
Dim fieldInfo As System.Reflection.FieldInfo = typ.GetField("window",
Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
Dim window As IntPtr = CType(fieldInfo, NativeWindow).Handle
But type FieldInfo cannot be converted to NativeWindow...
Type t = notifyIcon1.GetType()
IntPtr window =
((NativeWindow)t.GetField("window",System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.NonPublic).GetValue(notifyIcon1)).Handle;
As I understand it, the fragment:
window = ((NativeWindow)t.GetField(...
is casting an object of type System.Reflection.FieldInfo to NativeWindow
Am I interpreting that correctly?
I do not seem able to make the necessary conversion in VB.NET
This is as far as I've got:
Dim typ as Type = notifyIcon1.GetType()
Dim fieldInfo As System.Reflection.FieldInfo = typ.GetField("window",
Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
Dim window As IntPtr = CType(fieldInfo, NativeWindow).Handle
But type FieldInfo cannot be converted to NativeWindow...