jna

Java 批量ping操作

匿名 (未验证) 提交于 2019-12-02 21:53:52
批量ping操作 1 批量ping操作,所需jar包 < dependency > < groupId > net . sf . json - lib < /groupId> < artifactId > json - lib < /artifactId> < version > 2.4 < /version> < classifier > jdk13 < /classifier> < /dependency> < dependency > < groupId > net . java . dev . jna < /groupId> < artifactId > jna < /artifactId> < version > 4.0.0 < /version> < /dependency> < dependency > < groupId > net . java . dev . jna < /groupId> < artifactId > jna - platform < /artifactId> < version > 4.0.0 < /version> < /dependency> 2 工具包下载 点击下载工具包 dpso ,解压后,拷贝到linux下,如:/opt/log/目录下 3 Java测试代码 package com . wutongyu . test ;

call c++ function in Java with input and output arguments

戏子无情 提交于 2019-12-02 18:05:08
问题 I have a c++ code which has been connected to a visual basic user interface by someone else. Here is one of the functions code that connects c++ to visual basic: extern "C" void PASCAL EXPORT RCS( stAct* act,stResourceDirectory* resDir, stCalendar* calendar, short numOfAct, short numOfRes, short numOfCal, int nDataDate ) { Network network; short id; Activity* p_act; node<Activity>* p_node; // Setting network.create_calendars (calendar, numOfCal); network.set_data_date (nDataDate); set

How to pop up a text box(or tooltip) via script in Java

隐身守侯 提交于 2019-12-02 15:43:06
问题 I have a very specific question: I want to be able to, via a method call, popup a tooltip with text(it could say anything) in a given location on the screen for a certain amount of time on method call(say the logic is in a talk method) and fades away. How could I go about that? Is there a way to do it via JTooltip? Or would I have to dive into JNA to get what I want? I should mention I want the tooltip to popup with text in a given location without the cue of a mouse over, like a popup. Also,

How to manipulate memory from Java with JNA on Windows [closed]

僤鯓⒐⒋嵵緔 提交于 2019-12-02 15:19:44
How do I manipulate memory from Java? I know that Java runs in it's own JVM, so it can't access process memory directly. I heard about JNA which can be used to get interfaces between the Operating System and my Java code. Let's say I want to manipulate the score of Solitaire. The attempt would be something like this: get the process of solitaire get access to the memory of solitaire find out where the score is stored in the memory write my new value in the address Java itself can't access that memory, so how can I do this using JNA? Loki You need to use the JNA Library. Download the two Jar

Android JNA UnsatisfiedLinkError: Native library (com/sun/jna/xxx/libjnidispatch.so) not found

旧巷老猫 提交于 2019-12-02 12:57:05
Hey I am trying to set up a android studio project with JNA and libvirt java bindings. This is what the project structure looks like so far. however the solution did not work for me This is being tested not he emulator so far and the arm binaries have not been imported yet. When trying to use Connect method in the libvirt java bindings I get this error. There is a very similar post here 11-18 23:54:37.584 4182-4182/com.local.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.local.test, PID: 4182 java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-x86/libjnidispatch.so)

How to pop up a text box(or tooltip) via script in Java

送分小仙女□ 提交于 2019-12-02 10:17:17
I have a very specific question: I want to be able to, via a method call, popup a tooltip with text(it could say anything) in a given location on the screen for a certain amount of time on method call(say the logic is in a talk method) and fades away. How could I go about that? Is there a way to do it via JTooltip? Or would I have to dive into JNA to get what I want? I should mention I want the tooltip to popup with text in a given location without the cue of a mouse over, like a popup. Also, in case a tooltip is not the right way to go about what I want (which I hope I made clear), is there a

How to make GetLastError reliably work with JNA?

扶醉桌前 提交于 2019-12-02 09:53:09
问题 I'm using various Win32 API functions in my Java application and I use GetLastError to get information on failed API calls. Most of the time it works, but now I found a case where something seems to reset the last error. This is what I do both in my Java application and my VB6 application: I open the handle to the process with PID 4 (System) I call GetModuleFileNameEx with that handle. I call GetProcessImageFileName with that handle. Now both API functions fail as expected (they return zero)

Preparing JNA for use in Eclipse

牧云@^-^@ 提交于 2019-12-02 09:51:10
问题 Background: I'm doing machine learning research, and want to use the FANN library to construct neural networks. The source code is written in C, but I need it wrapped so that I can use it with a lot of Java classes we've created. Question: The website provides a link to an already well received wrapper software called fannj. Its dependencies is the FANN library source code and JNA. I've never done wrapping before so JNA is brand new to me. The github homepage for the code mentions " you must

How to detect when a process/ thread is waiting for user input

荒凉一梦 提交于 2019-12-02 07:24:00
Is there a way to detect when a windows process is waiting for user input. For instance, when you click on a particular program it loads, in this case the program's process is probably in loading state rite? what happens when the program is fully loaded and is waiting for user input to procedure to next step. Is there a way to detect this? Cheers Call WaitForInputIdle with a handle to a process. it will suspend execution until the program completes its initialization and is waiting for user input with no input pending. 来源: https://stackoverflow.com/questions/6911498/how-to-detect-when-a

Adding another method to JNA Class Java (Kernel32)

别说谁变了你拦得住时间么 提交于 2019-12-02 07:23:56
问题 I was trying to use a method from WIN32 dll, not included in JNA. The Method is GetProductInfo I try this in separate project and work: public interface Kernel32 extends Library { public boolean GetProductInfo(int dwOSMajorVersion,int dwOSMinorVersion, int dwSpMajorVersion, int dwSpMinorVersion, IntByReference pdwReturnedProductType); } Using.. Kernel32 lib = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class); IntByReference dwType = new IntByReference(); lib.GetProductInfo(6,0,0,0