本文整理汇总了Java中com.sun.jna.platform.win32.Shell32类的典型用法代码示例。如果您正苦于以下问题:Java Shell32类的具体用法?Java Shell32怎么用?Java Shell32使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Shell32类属于com.sun.jna.platform.win32包,在下文中一共展示了Shell32类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getUnityUserPath
import com.sun.jna.platform.win32.Shell32; //导入依赖的package包/类
@Nullable
private static String getUnityUserPath()
{
if(SystemInfo.isWinVistaOrNewer)
{
PointerByReference pointerByReference = new PointerByReference();
WinNT.HRESULT hresult = Shell32.INSTANCE.SHGetKnownFolderPath(Guid.GUID.fromString("{A520A1A4-1780-4FF6-BD18-167343C5AF16}"), 0, null, pointerByReference);
if(hresult.longValue() != 0)
{
return null;
}
return pointerByReference.getValue().getWideString(0) + "\\Unity";
}
else if(SystemInfo.isMac)
{
return SystemProperties.getUserHome() + "/Library/Unity";
}
else if(SystemInfo.isLinux)
{
return SystemProperties.getUserHome() + "/.config/unity3d";
}
return null;
}
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:26,代码来源:Unity3dPackageWatcher.java
示例2: extractExeIcon
import com.sun.jna.platform.win32.Shell32; //导入依赖的package包/类
public static BufferedImage extractExeIcon(String fullExeFile, int index, boolean large) {
PointerByReference iconsLargeRef = new PointerByReference();
PointerByReference iconsSmallRef = new PointerByReference();
int cnt = Shell32.INSTANCE.ExtractIconEx(fullExeFile, index, iconsLargeRef, iconsSmallRef, new WinDef.UINT(1)).intValue();
if (cnt == 0) {
return null;
}
Pointer iconsLarge = iconsLargeRef.getPointer();
Pointer iconsSmall = iconsSmallRef.getPointer();
WinDef.HICON icon;
if (large) {
icon = new WinDef.HICON(iconsLarge.getPointer(0));
} else {
icon = new WinDef.HICON(iconsSmall.getPointer(0));
}
BufferedImage ic = iconToImage(icon);
User32.INSTANCE.DestroyIcon(icon);
return ic;
}
开发者ID:jindrapetrik,项目名称:jpexs-decompiler,代码行数:23,代码来源:Win32ProcessTools.java
示例3: configure
import com.sun.jna.platform.win32.Shell32; //导入依赖的package包/类
@Override
protected void configure() {
bind(User32.class).toInstance(User32.INSTANCE);
expose(User32.class);
bind(Kernel32.class).toInstance(Kernel32.INSTANCE);
expose(Kernel32.class);
bind(Advapi32.class).toInstance(Advapi32.INSTANCE);
expose(Advapi32.class);
bind(Shell32.class).toInstance(Shell32.INSTANCE);
expose(Shell32.class);
}
开发者ID:msiedlarek,项目名称:winthing,代码行数:15,代码来源:WindowsModule.java
示例4: SystemService
import com.sun.jna.platform.win32.Shell32; //导入依赖的package包/类
@Inject
public SystemService(final Kernel32 kernel32, final Advapi32 advapi32,
final Shell32 shell32) throws SystemException {
this.kernel32 = Objects.requireNonNull(kernel32);
this.advapi32 = Objects.requireNonNull(advapi32);
this.shell32 = Objects.requireNonNull(shell32);
escalatePrivileges(REQUIRED_PRIVILEGES);
}
开发者ID:msiedlarek,项目名称:winthing,代码行数:9,代码来源:SystemService.java
示例5: getShellIcon
import com.sun.jna.platform.win32.Shell32; //导入依赖的package包/类
public static BufferedImage getShellIcon(String path) {
SHFILEINFO fi = new SHFILEINFO();
BaseTSD.DWORD_PTR r = Shell32.INSTANCE.SHGetFileInfo(path, 0, fi, fi.size(), Shell32.SHGFI_ICON | Shell32.SHGFI_SMALLICON);
if (r.intValue() == 0) {
return null;
}
return iconToImage(fi.hIcon);
}
开发者ID:jindrapetrik,项目名称:jpexs-decompiler,代码行数:9,代码来源:Win32ProcessTools.java
示例6: resolveFolder
import com.sun.jna.platform.win32.Shell32; //导入依赖的package包/类
public String resolveFolder(FolderId folderId) {
int folder = convertFolderId(folderId);
char[] pszPath = new char[WinDef.MAX_PATH];
HRESULT result = Shell32.INSTANCE.SHGetFolderPath(null, folder, null, null,
pszPath);
if (W32Errors.S_OK.equals(result)) {
return Native.toString(pszPath);
}
logger.error("SHGetFolderPath returns an error: {}", result.intValue());
throw new AppDirsException(
"SHGetFolderPath returns an error: " + result.intValue());
}
开发者ID:harawata,项目名称:appdirs,代码行数:15,代码来源:ShellFolderResolver.java
注:本文中的com.sun.jna.platform.win32.Shell32类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论