C#中动态调用API函数
来源:互联网 发布:php到底是做什么的 编辑:程序博客网 时间:2024/04/27 05:01
using System.Runtime.InteropServices;
internal delegate bool Delegate_Beep(uint dwFreq, uint dwDuration);
[DllImport("kernel32.dll")]
internal static extern IntPtr LoadLibrary(string lpLibFileName);
[DllImport("kernel32.dll")]
internal static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
[DllImport("kernel32.dll")]
internal static extern bool FreeLibrary(IntPtr hLibModule);
private void button1_Click(object sender, EventArgs e)
{
IntPtr vLibraryHandle = LoadLibrary("Kernel32.dll");
IntPtr vProcAddress = GetProcAddress(vLibraryHandle, "Beep");
Delegate_Beep Beep = Marshal.GetDelegateForFunctionPointer(
vProcAddress, typeof(Delegate_Beep)) as Delegate_Beep;
Beep(100, 100);
FreeLibrary(vLibraryHandle);
}
- C#中动态调用API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- C#中调用一些API函数
- C# 中 调用 Win API 函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- 在C#中调用windows API函数
- c# 中调用win32的api函数
- 动态调用API函数
- C#调用API函数
- C#调用API函数
- C#调用API函数
- 创建.Text Blog的自定义Skin
- ajax中的键盘事件注意使用keyup
- Algebraic Aspects of the Advanced Encryption Standard
- MULTi PACK 41 PROGRAMS AIO
- Dictionary of Analysis, Calculus, and Differential Equations (re-upload)
- C#中动态调用API函数
- OutRun 2006: Coast 2 Coast
- (转)WTL开发者指南(WTL Developer’s Guide翻译2)
- 准备将此Blog与我自己的http://www.kaoiki.com技术帖同步
- ASP.NET 根据当前日期生成当月日历
- SSH框架搭建
- 离成功多远?
- ATl中字符转换宏
- Hibernate+ehcache二级缓存技术