熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

C#中調用Windows API時的數據類型對應關系

2022-06-13   來源: .NET編程 

  BOOL=SystemInt

  BOOLEAN=SystemInt

  BYTE=SystemUInt

  CHAR=SystemInt

  COLORREF=SystemUInt

  DWORD=SystemUInt

  DWORD=SystemUInt

  DWORD=SystemUInt

  FLOAT=SystemFloat

  HACCEL=SystemIntPtr

  HANDLE=SystemIntPtr

  HBITMAP=SystemIntPtr

  HBRUSH=SystemIntPtr

  HCONV=SystemIntPtr

  HCONVLIST=SystemIntPtr

  HCURSOR=SystemIntPtr

  HDC=SystemIntPtr

  HDDEDATA=SystemIntPtr

  HDESK=SystemIntPtr

  HDROP=SystemIntPtr

  HDWP=SystemIntPtr

  HENHMETAFILE=SystemIntPtr

  HFILE=SystemIntPtr

  HFONT=SystemIntPtr

  HGDIOBJ=SystemIntPtr

  HGLOBAL=SystemIntPtr

  HHOOK=SystemIntPtr

  HICON=SystemIntPtr

  HIMAGELIST=SystemIntPtr

  HIMC=SystemIntPtr

  HINSTANCE=SystemIntPtr

  HKEY=SystemIntPtr

  HLOCAL=SystemIntPtr

  HMENU=SystemIntPtr

  HMETAFILE=SystemIntPtr

  HMODULE=SystemIntPtr

  HMONITOR=SystemIntPtr

  HPALETTE=SystemIntPtr

  HPEN=SystemIntPtr

  HRGN=SystemIntPtr

  HRSRC=SystemIntPtr

  HSZ=SystemIntPtr

  HWINSTA=SystemIntPtr

  HWND=SystemIntPtr

  INT=SystemInt

  INT=SystemInt

  INT=SystemInt

  LONG=SystemInt

  LONG=SystemInt

  LONG=SystemInt

  LONGLONG=SystemInt

  LPARAM=SystemIntPtr

  LPBOOL=SystemInt[]

  LPBYTE=SystemUInt[]

  LPCOLORREF=SystemUInt[]

  LPCSTR=SystemString

  LPCTSTR=SystemString

  LPCVOID=SystemUInt

  LPCWSTR=SystemString

  LPDWORD=SystemUInt[]

  LPHANDLE=SystemUInt

  LPINT=SystemInt[]

  LPLONG=SystemInt[]

  LPSTR=SystemString

  LPTSTR=SystemString

  LPVOID=SystemUInt

  LPWORD=SystemInt[]

  LPWSTR=SystemString

  LRESULT=SystemIntPtr

  PBOOL=SystemInt[]

  PBOOLEAN=SystemInt[]

  PBYTE=SystemUInt[]

  PCHAR=SystemChar[]

  PCSTR=SystemString

  PCTSTR=SystemString

  PCWCH=SystemUInt

  PCWSTR=SystemUInt

  PDWORD=SystemInt[]

  PFLOAT=SystemFloat[]

  PHANDLE=SystemUInt

  PHKEY=SystemUInt

  PINT=SystemInt[]

  PLCID=SystemUInt

  PLONG=SystemInt[]

  PLUID=SystemUInt

  PSHORT=SystemInt[]

  PSTR=SystemString

  PTBYTE=SystemChar[]

  PTCHAR=SystemChar[]

  PTSTR=SystemString

  PUCHAR=SystemChar[]

  PUINT=SystemUInt[]

  PULONG=SystemUInt[]

  PUSHORT=SystemUInt[]

  PVOID=SystemUInt

  PWCHAR=SystemChar[]

  PWORD=SystemInt[]

  PWSTR=SystemString

  REGSAM=SystemUInt

  SC_HANDLE=SystemIntPtr

  SC_LOCK=SystemIntPtr

  SHORT=SystemInt

  SIZE_T=SystemUInt

  SSIZE_=SystemUInt

  TBYTE=SystemChar

  TCHAR=SystemChar

  UCHAR=SystemByte

  UINT=SystemUInt

  UINT=SystemUInt

  UINT=SystemUInt

  ULONG=SystemUInt

  ULONG=SystemUInt

  ULONG=SystemUInt

  ULONGLONG=SystemUInt

  USHORT=SystemUInt

  WORD=SystemUInt

  WPARAM=SystemIntPtr

  附舉一個聲明API的例子

  [ DllImport( "Kerneldll" )]

  public static extern SystemUInt VirtualAllocEx(

  SystemIntPtr hProcess

  SystemUInt lpAddress

  SystemUInt dwSize

  SystemUInt flAllocationType

  SystemUInt flProtect

  );


From:http://tw.wingwit.com/Article/program/net/201311/14189.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.