Java JNA sendMessage() not found

Deadly 提交于 2019-12-05 21:40:31
gredezcici
public interface User32Ext extends User32 {
User32Ext USER32EXT = (User32Ext) Native.loadLibrary("user32",

        User32Ext.class, W32APIOptions.DEFAULT_OPTIONS);

HWND FindWindowEx(HWND lpParent, HWND lpChild, String lpClassName,
        String lpWindowName);

HWND GetTopWindow(HWND hwnd);

HWND GetParent(HWND hwnd);

HWND GetDesktopWindow();

int SendMessage(HWND hWnd, int dwFlags, byte bVk, int dwExtraInfo);

int SendMessage(HWND hWnd, int Msg, int wParam, String lParam);

void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);

void SwitchToThisWindow(HWND hWnd, boolean fAltTab);

}

You need to define this function yourself. All windows functions are not predefined.

Example: (untested - usage example only)

public interface MyUser32 extends User32 {
    MyUser32 INSTANCE = (MyUser32)Native.loadLibrary("user32", MyUser32.class, W32APIOptions.DEFAULT_OPTIONS);
    LRESULT SendMessage(HWND hWnd, int Msg, WPARAM wParam, LPARAM lParam);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!