问题描述
|
我需要使用它,但是在pinvoke中我无法获得该API的声明。
那么...有没有办法声明它?
如果您有使用的示例,那将是完美的,因为这是我第一次使用该api。
解决方法
using System;
using System.Runtime.InteropServices;
using System.Text;
//...
[DllImport(\"kernel32.dll\",SetLastError = true,CharSet = CharSet.Auto)]
static extern bool QueryFullProcessImageName(IntPtr hProcess,uint dwFlags,[Out,MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpExeName,ref uint lpdwSize);
有关用法,请参阅文档。