C#如何调用API函数

luhongming 2003-08-21 10:51:11
C#中如何调用API函数。
...全文
58 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
dotnba 2003-08-24
  • 打赏
  • 举报
回复
看看:
<Root>\SDK\v1.1\Samples\Technologies\Interop\PlatformInvoke
luhongming 2003-08-21
  • 打赏
  • 举报
回复
HWND SetCapture( HWND hWnd );
我现在要调用这个API函数,应该怎么声明该函数。声明应该写在什么地方。
zynjj 2003-08-21
  • 打赏
  • 举报
回复
public class Win32 {
[DllImport("user32.dll", EntryPoint="MessageBox")]
public static extern int MsgBox(int hWnd, String text, String caption, uint type);
}
doose 2003-08-21
  • 打赏
  • 举报
回复
http://www.yesky.com/SoftChannel/72342380468109312/20020719/1621165.shtml

http://www.yesky.com/SoftChannel/72342380468109312/20030522/1702593.shtml
kuangren 2003-08-21
  • 打赏
  • 举报
回复
像上面一样,声明一下就可以调用了~
http://expert.csdn.net/Expert/topic/2065/2065226.xml?temp=.182873
luhongming 2003-08-21
  • 打赏
  • 举报
回复
请问什么地方有关于介绍C# API的资料的网站。
czsd 2003-08-21
  • 打赏
  • 举报
回复
还有一定要在开头声明using System.Runtime.InteropServices ;
Montaque 2003-08-21
  • 打赏
  • 举报
回复
http://www.digitalearth.net.cn/GISRelatedITIssues/CSharp/CCapture.htm
freeboy0002 2003-08-21
  • 打赏
  • 举报
回复
声明一下即可

[DllImport("kernel32.dll")]
protected static extern uint GetLastError();



110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧