Hi!
How to get form handle in VB .NET? In VB 6 I use this:
Thank you!Code:Dim wHandle as Long
wHandle = frmMain.hWnd
Printable View
Hi!
How to get form handle in VB .NET? In VB 6 I use this:
Thank you!Code:Dim wHandle as Long
wHandle = frmMain.hWnd
In .NET , we do it like so
VB Code:
Dim lng As Long = Me.Handle.ToInt32
Int32 is an Integer data type.
VB Code:
Dim hWnd as Integer = Me.Handle.ToInt32
Or just leave it an IntPtr. That way it won't overflow as soon as you run the app on a 64 bit OS. It depends what you want to do with it though.
VB Code:
Dim hWnd as IntPtr = Me.Handle
I learn something new everyday. =)
I thank to all of you for help.