有什麼辦法可以直接使用Win32Native命名空間嗎?是否可以直接使用Microsoft.Win32命名空間中的Win32Native類?
我想直接調用方法:
Win32Native.SendMessageTimeout(new IntPtr(0xffff), 0x1a, IntPtr.Zero, "Environment", 0, 0x3e8, IntPtr.Zero) == IntPtr.Zero;
,而不是它聲明:
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessageTimeout(IntPtr hWnd, int Msg, IntPtr wParam, string lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);
是否有這樣的機會?
這裏是一個很好的參考一下從以前StackOverFlowPost它使偉大的recommedations以及一些工具,你可以使用incases其中非託管的.dll dependecys可能不存在,以及... http://stackoverflow.com/問題/ 4655294 /無法加載win32-native-dll-file-from-c-net – MethodMan 2012-01-10 16:54:28
感謝您的評論。我沒有麻煩導入DLL。 – Daro 2012-01-10 17:15:26