上代码,很短
public class helloWindows {
public static void main(String[] args) throws InterruptedException {
Thread.sleep(2000);
WinDef.HWND hwnd = User32.INSTANCE.FindWindow("kugou_ui",null);
RECT rect = (RECT)RECT.newInstance(RECT.class);
User32.INSTANCE.GetWindowRect(hwnd, rect);
System.out.println(rect.toRectangle().toString() );
}
}
那个rect 用new初始化和用这种方法编译都没有问题,但是运行的时候总会报错。各位大神,这个rect到底怎么初始化啊
public class helloWindows {
public static void main(String[] args) throws InterruptedException {
Thread.sleep(2000);
WinDef.HWND hwnd = User32.INSTANCE.FindWindow("kugou_ui",null);
RECT rect = (RECT)RECT.newInstance(RECT.class);
User32.INSTANCE.GetWindowRect(hwnd, rect);
System.out.println(rect.toRectangle().toString() );
}
}
那个rect 用new初始化和用这种方法编译都没有问题,但是运行的时候总会报错。各位大神,这个rect到底怎么初始化啊