

Dim hProcess As UInteger = SDK.WinAPI.GetModuleHandleA("notepad.exe")
The type initializer for 'WinAPI' threw an exception. ... A first chance exception of type 'System.TypeInitializationException' occurred in Project1.exe
Using hwnd As New SDK.ProcessHandle(Process.GetProcessesByName("notepad.exe")(0).Id)
'use the handle here
End Using