【发布时间】:2019-04-18 06:17:55
【问题描述】:
我正在使用 jna.extra.User32Extra 库,我必须更改 windowdisplayaffinity 值。 不幸的是,输出总是错误的,我不知道为什么,而且这段代码不起作用。我希望 WDA_MONITOR 在打印屏幕时使窗口变黑
public class Browser extends Application {
@Override
public void start(Stage stage) throws Exception {
StackPane pane = new StackPane();
WebView view = new WebView();
WebEngine engine = view.getEngine();
engine.load("https://google.com");
pane.getChildren().add(view);
Scene scene = new Scene(pane, 1280, 720);
stage.setTitle("Browser JAVA");
stage.setScene(scene);
WinDef.HWND hWnd = User32.INSTANCE.FindWindow(null, "");
boolean output = User32Extra.INSTANCE.SetWindowDisplayAffinity(hWnd, 1);
System.out.println("output "+output);//false
stage.show();
}
public static void main(String[] args) throws IOException {
Application.launch(args);
}
}
【问题讨论】:
标签: java winapi screen-scraping jna