find函数 java,Java JNA FindWindow()-查找函数"FindWindow"时出错:找不到指定的过程

I'm trying to bring to front a window named MyWindowTitle, using JNA.

import com.sun.jna.Native;

import com.sun.jna.win32.StdCallLibrary;

import com.sun.jna.platform.win32.WinDef.HWND;

public class ToFront {

public static interface User32 extends StdCallLibrary {

final User32 instance = (User32) Native.loadLibrary ("user32", User32.class);

HWND FindWindow(String winClass, String title);

boolean ShowWindow(HWND hWnd, int nCmdShow);

boolean SetForegroundWindow(HWND hWnd);

}

public static void main(String[] args) {

HWND hwnd = User32.instance.FindWindow(null, "MyWindowTitle");

User32.instance.ShowWindow(hwnd, 9);

User32.instance.SetForegroundWindow(hwnd);

}

}

I'm getting the following exception java.lang.UnsatisfiedLinkError: Error looking up function 'FindWindow': The specified procedure could not be found.

解决方案

Check the spelling of your function. You can use dependency walker to see if that function exists in your dll.

Ps : when I opened user32.dll those are the functions I found

:FindWindowA,FindWindowExA,FindWindowExW,FindWindowW

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值