org.eclipse.swt.internal.win32.OS Java Examples

The following examples show how to use org.eclipse.swt.internal.win32.OS. 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: BidiLayout.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public static boolean setSpecificKeyboardLanguage(int langCode){
	int currentLang = OS.PRIMARYLANGID(OS.LOWORD(OS.GetKeyboardLayout(0)));
	if (currentLang == langCode) {
		return true;
	}
	int [] list = getKeyboardLanguageList();
	for (int element : list) {
		if (langCode == OS.PRIMARYLANGID(OS.LOWORD(element))) {
			OS.ActivateKeyboardLayout(element, 0);
			return true;
		}
	}
	return false;
}
 
Example #2
Source File: BidiLayout.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
static int [] getKeyboardLanguageList() {
	int maxSize = 10;
	int [] tempList = new int [maxSize];
	int size = OS.GetKeyboardLayoutList(maxSize, tempList);
	int [] list = new int [size];
	System.arraycopy(tempList, 0, list, 0, size);
	return list;
}
 
Example #3
Source File: PlatformWin32VKCanvas.java    From lwjgl3-swt with MIT License 5 votes vote down vote up
@Override
public long create(Composite composite, VKData data) {
    VkWin32SurfaceCreateInfoKHR sci = VkWin32SurfaceCreateInfoKHR.callocStack()
      .sType(VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR)
      .hinstance(OS.GetModuleHandle(null))
      .hwnd(composite.handle);
    LongBuffer pSurface = stackMallocLong(1);
    int err = vkCreateWin32SurfaceKHR(data.instance, sci, null, pSurface);
    long surface = pSurface.get(0);
    if (err != VK_SUCCESS) {
        throw new SWTException("Calling vkCreateWin32SurfaceKHR failed with error: " + err);
    }
    return surface;
}
 
Example #4
Source File: DestroyCaretFocusListener.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void focusGained(FocusEvent e) {
	OS.DestroyCaret();
}