javawindowsdlljnawallpaper

ShObjIdl location for JNA usage


I'm trying to use shobjidl_core.h library to run code that changes the wallpaper of one specific monitor, specifically I need to run these two functions: GetMonitorDevicePathAt, SetWallpaper.

Now, when I run the following code:

    interface shobjidl_core extends Library {
        test.shobjidl_core INSTANCE = Native.load( "shobjidl_core", shobjidl_core.class);

        void GetMonitorDevicePathAt(int monitorIndex, WString m);
        void SetWallpaper(WString monitorId, WString wallpaperPath);
    }

I get an error saying "Unable to load library 'shobjidl'"

I've tried any variation of "shobjidl" but still I can't find one that works. From what I understood about JNA it need a dll containing the library, but I can't find any dll related to shobjidl

What should I do to load shobjidl?


Solution

  • I was helped on the JNA google group. The answer that solved my issue can be seen here. If you want to see a use case example on how to do this you can check it on github