标签:int library err lib load class extends instance style
笔记整理:
1 /*java获取cmd启动程序的PID */
2 /*zzq581573832013-05-08上传*/
3 //代码:
4 static interface Kernel32 extends Library{
5 public static Kernel32 INSTANCE=(Kernel32)
6 Native.loadLibrary("kernel32", Kernel32.class);
7 public int GetProcessId(Long hProcess);
8 }
9 try {
10 Field f = p.getClass().getDeclaredField("handle");
11 f.setAccessible(true);
12 long pid = Kernel32.INSTANCE.GetProcessId((Long) f.get(p));
13 System.err.println(pid);
14 }
标签:int library err lib load class extends instance style
原文地址:http://www.cnblogs.com/Freedom-and-life/p/6661986.html