我嘗試使用:在Java中使用SendMessage函數從user32.dll中在Java JNA - 錯誤
LRESULT WINAPI SendMessage(_In_ HWND hWnd, _In_ UINT Msg,
_In_ WPARAM wParam, _In_ LPARAM lParam);
與JNA和我不斷收到一個錯誤:
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是正確的。我的錯誤在哪裏?
您使用的是Java 32位還是64位版本? – Robert
我想我已經安裝了 - 我該如何檢查? – Dominik
你如何運行該程序? – Robert