I have an method here
HRESULT GetImage(
SIZE size,
SIIGBF flags,
HBITMAP *phbm
);
which takes SIIGBF as an parameter. SIIGBF is an enum you can see here.
As described in this post I create the enum like this:
public static interface SIIGBF {
public static final int SIIGBF_RESIZETOFIT = 0x00000000;
public static final int SIIGBF_BIGGERSIZEOK = 0x00000001;
public static final int SIIGBF_MEMORYONLY = 0x00000002;
public static final int SIIGBF_ICONONLY = 0x00000004;
public static final int SIIGBF_THUMBNAILONLY = 0x00000008;
public static final int SIIGBF_INCACHEONLY = 0x00000010;
};
I mapped the method at the top so:
WinNT.HRESULT GetImage(WinUser.SIZE size, int flags, WinDef.HBITMAP phbm) {
return (WinNT.HRESULT) _invokeNativeObject(3,new Object[]{getPointer(),size,flags,phbm},WinNT.HRESULT.class);
}
I run the method like this:
WinNT.HRESULT hr = factory.GetImage(size,Shell32Extra.SIIGBF.SIIGBF_RESIZETOFIT,hbitmap);
But it returns an Invalid memory access error and maybe it`s because of the enum that put in as an Integer. Can you please help me.
User contributions licensed under CC BY-SA 3.0