/* * Copyright 2016 MovingBlocks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.terasology.launcher.util.windows; import com.sun.jna.Native; import com.sun.jna.platform.win32.Guid; import com.sun.jna.platform.win32.WinDef; import com.sun.jna.platform.win32.WinNT; import com.sun.jna.ptr.PointerByReference; import com.sun.jna.win32.StdCallLibrary; import com.sun.jna.win32.W32APIOptions; /** * Access to the Windows Shell32 library, for the purpose of looking up special directory paths (Windows Vista/7 only). */ public interface Shell32 extends StdCallLibrary { String FOLDERID_SAVED_GAMES = "{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}"; String FOLDERID_DOCUMENTS = "{FDD39AD0-238F-46AF-ADB4-6C85480369C7}"; Shell32 INSTANCE = (Shell32) Native.loadLibrary("shell32", Shell32.class, W32APIOptions.UNICODE_OPTIONS); int SHGetKnownFolderPath(Guid.GUID rfid, int dwFlags, WinNT.HANDLE hToken, PointerByReference pszPath); int SHGetFolderPath(WinDef.HWND hwndOwner, int nFolder, WinNT.HANDLE hToken, int dwFlags, char[] pszPath); }