当前位置: 首页>>代码示例>>Java>>正文


Java W32APIFunctionMapper类代码示例

本文整理汇总了Java中com.sun.jna.win32.W32APIFunctionMapper的典型用法代码示例。如果您正苦于以下问题:Java W32APIFunctionMapper类的具体用法?Java W32APIFunctionMapper怎么用?Java W32APIFunctionMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


W32APIFunctionMapper类属于com.sun.jna.win32包,在下文中一共展示了W32APIFunctionMapper类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WindowsShutdownManagerImpl

import com.sun.jna.win32.W32APIFunctionMapper; //导入依赖的package包/类
WindowsShutdownManagerImpl() {
	// Use the Unicode versions of Win32 API calls
	Map<String, Object> m = new HashMap<>();
	m.put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
	m.put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
	options = Collections.unmodifiableMap(m);
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:8,代码来源:WindowsShutdownManagerImpl.java

示例2: defaultDirectory

import com.sun.jna.win32.W32APIFunctionMapper; //导入依赖的package包/类
/**
 * Returns the correct userDataFolder for the given application name.
 */
public static String defaultDirectory() {
	// default
	String folder = "." + File.separator;

	if (isMac()) {
		folder = System.getProperty("user.home") + File.separator + "Library" + File.separator
				 + "Application Support";
	} else if (isWindows()) {

		Map<String, Object> options = Maps.newHashMap();
		options.put(Library.OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
		options.put(Library.OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);

		HWND hwndOwner   = null;
		int nFolder		 = Shell32.CSIDL_LOCAL_APPDATA;
		HANDLE hToken    = null;
		int dwFlags		 = Shell32.SHGFP_TYPE_CURRENT;
		char pszPath[]   = new char[Shell32.MAX_PATH];
		Shell32 instance = (Shell32) Native.loadLibrary("shell32", Shell32.class, options);
		int hResult		 = instance.SHGetFolderPath(hwndOwner, nFolder, hToken, dwFlags, pszPath);
		if (Shell32.S_OK == hResult) {

			String path = new String(pszPath);
			int len     = path.indexOf('\0');
			folder	    = path.substring(0, len);
		} else {
			System.err.println("Error: " + hResult);
		}
	}

	folder = folder + File.separator + "SpaceCubes" + File.separator;

	return folder;
}
 
开发者ID:IgnisIncendio,项目名称:space-cubes,代码行数:38,代码来源:SystemNativesHelper.java

示例3: WindowsShutdownManagerImpl

import com.sun.jna.win32.W32APIFunctionMapper; //导入依赖的package包/类
WindowsShutdownManagerImpl() {
	// Use the Unicode versions of Win32 API calls
	Map<String, Object> m = new HashMap<String, Object>();
	m.put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
	m.put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
	options = Collections.unmodifiableMap(m);
}
 
开发者ID:kiggundu,项目名称:briar,代码行数:8,代码来源:WindowsShutdownManagerImpl.java


注:本文中的com.sun.jna.win32.W32APIFunctionMapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。