com.sun.jna.platform.win32.Guid Java Examples

The following examples show how to use com.sun.jna.platform.win32.Guid. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Unity3dPackageWatcher.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
@Nonnull
private static List<String> getUnityUserPaths()
{
	List<String> paths = new SmartList<>();
	if(SystemInfo.isWinVistaOrNewer)
	{
		paths.add(Shell32Util.getFolderPath(ShlObj.CSIDL_LOCAL_APPDATA) + "\\Unity");

		PointerByReference pointerByReference = new PointerByReference();
		// LocalLow
		WinNT.HRESULT hresult = Shell32.INSTANCE.SHGetKnownFolderPath(Guid.GUID.fromString("{A520A1A4-1780-4FF6-BD18-167343C5AF16}"), 0, null, pointerByReference);

		if(hresult.longValue() == 0)
		{
			paths.add(pointerByReference.getValue().getWideString(0) + "\\Unity");
		}
	}
	else if(SystemInfo.isMac)
	{
		paths.add(SystemProperties.getUserHome() + "/Library/Unity");
	}
	else if(SystemInfo.isLinux)
	{
		paths.add(SystemProperties.getUserHome() + "/.config/unity3d");
	}

	return paths;
}
 
Example #2
Source File: Win32Utils.java    From cate with MIT License 2 votes vote down vote up
/**
 * See https://msdn.microsoft.com/en-us/library/bb762188(v=vs.85).aspx
 */
int SHGetKnownFolderPath(Guid.GUID hwndOwner, int dwFlags, HANDLE hToken,
                                PointerByReference ppszPath);