1)
[DllImport("user32.dll", EntryPoint = "ShowWindow")]
private static extern bool ShowWindow(IntPtr nClientID, int nCmdShow);
2)
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
本文提供了两个DLL调用的示例代码,分别演示了如何使用C#调用user32.dll中的ShowWindow函数来控制窗口显示,以及如何调用gdi32.dll中的DeleteObject函数删除指定的对象。
1)
[DllImport("user32.dll", EntryPoint = "ShowWindow")]
private static extern bool ShowWindow(IntPtr nClientID, int nCmdShow);
2)
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
967
5462

被折叠的 条评论
为什么被折叠?