我尝试使用:
LRESULT WINAPI SendMessage(_In_ HWND hWnd, _In_ UINT Msg,
_In_ WPARAM wParam, _In_ LPARAM lParam);
在带有 jna 的 Java 中,我不断收到错误消息:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Error looking up function 'SendMessage'
这是我的界面:
public interface User32 extends StdCallLibrary {
Pointer GetForegroundWindow();
int SendMessage(Pointer hWnd, int msg, int num1, int num2);
我这样称呼它:
Pointer hW = user32.GetForegroundWindow();
user32.SendMessage(hW, 0x0201, 0, 0);
user32.SendMessage(hW, 0x0202, 0, 0);
hWnd 是对的。我的错误在哪里?