| VB.NET | |
|
001 002 003 004 005 006 007 008 009 010 011 012 013 |
Public Shared Sub Main() Dim hInstance As IntPtr hInstance = GetHInstance() End Sub Public Shared Function GetHInstance() As IntPtr Return Marshal.GetHINSTANCE([Assembly].GetExecutingAssembly().GetModules()(0)) End Function |
| C# | |
|
001 002 003 004 005 006 007 008 009 010 011 |
public static void Main() { IntPtr hInstance; hInstance = GetHInstance(); } public static IntPtr GetHInstance() { return Marshal.GetHINSTANCE( Assembly.GetExecutingAssembly().GetModules()[0] ); } |