mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 05:51:31 -04:00
Try to fix 32-bit MWS support
This commit is contained in:
parent
d78991be3a
commit
28d126b5a8
17
source/net/filebot/platform/windows/Kernel32.java
Normal file
17
source/net/filebot/platform/windows/Kernel32.java
Normal file
@ -0,0 +1,17 @@
|
||||
package net.filebot.platform.windows;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.platform.win32.WTypes.LPWSTR;
|
||||
import com.sun.jna.platform.win32.WinDef.UINTByReference;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
import com.sun.jna.win32.W32APIOptions;
|
||||
|
||||
public interface Kernel32 extends StdCallLibrary {
|
||||
|
||||
public static final long APPMODEL_ERROR_NO_PACKAGE = 15700;
|
||||
|
||||
Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS);
|
||||
|
||||
long GetCurrentPackageFullName(UINTByReference packageFullNameLength, LPWSTR packageFullName);
|
||||
|
||||
}
|
@ -8,9 +8,14 @@ import java.util.logging.Level;
|
||||
|
||||
import javax.swing.UIManager;
|
||||
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.WString;
|
||||
import com.sun.jna.platform.win32.Shell32;
|
||||
import com.sun.jna.platform.win32.WinDef.UINT;
|
||||
import com.sun.jna.platform.win32.WinDef.UINTByReference;
|
||||
import com.sun.jna.platform.win32.WinError;
|
||||
import com.sun.jna.platform.win32.WTypes.LPWSTR;
|
||||
import com.sun.jna.ptr.PointerByReference;
|
||||
|
||||
public class WinAppUtilities {
|
||||
@ -35,6 +40,25 @@ public class WinAppUtilities {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getPackageName() {
|
||||
System.out.println("WinAppUtilities.getPackageName()");
|
||||
|
||||
UINTByReference length = new UINTByReference(new UINT(0));
|
||||
Kernel32.INSTANCE.GetCurrentPackageFullName(length, null);
|
||||
|
||||
System.out.println(length);
|
||||
System.out.println(length.getValue());
|
||||
System.out.println(length.getValue().longValue());
|
||||
|
||||
LPWSTR lpwstr = new LPWSTR(new Memory(length.getValue().intValue() * Native.WCHAR_SIZE));
|
||||
Kernel32.INSTANCE.GetCurrentPackageFullName(length, lpwstr);
|
||||
System.out.println(length);
|
||||
System.out.println(length.getValue());
|
||||
System.out.println(lpwstr);
|
||||
|
||||
return lpwstr.toString();
|
||||
}
|
||||
|
||||
public static void initializeApplication(String aumid) {
|
||||
if (aumid != null) {
|
||||
setAppUserModelID(aumid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user