|
26 | 26 | import com.sun.jna.LastErrorException;
|
27 | 27 | import com.sun.jna.Native;
|
28 | 28 | import com.sun.jna.Pointer;
|
29 |
| -import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR; |
30 |
| -import com.sun.jna.platform.win32.WinNT.HANDLE; |
31 | 29 | import com.sun.jna.ptr.IntByReference;
|
32 | 30 | import com.sun.jna.ptr.PointerByReference;
|
33 | 31 | import com.sun.jna.win32.StdCallLibrary;
|
@@ -4387,4 +4385,77 @@ Pointer VirtualAllocEx(HANDLE hProcess, Pointer lpAddress, SIZE_T dwSize,
|
4387 | 4385 | * </p>
|
4388 | 4386 | */
|
4389 | 4387 | boolean VirtualUnlock(Pointer lpAddress, SIZE_T dwSize);
|
| 4388 | + |
| 4389 | + /** |
| 4390 | + * Sets the user interface language for the current thread. |
| 4391 | + * |
| 4392 | + * <p> |
| 4393 | + * Windows Vista and later: This function cannot clear the thread preferred UI languages list. Your MUI application |
| 4394 | + * should call SetThreadPreferredUILanguages to clear the language list. |
| 4395 | + * </p> |
| 4396 | + * <p> |
| 4397 | + * Windows XP: This function is limited to allowing the operating system to identify and set a value that is safe |
| 4398 | + * to use on the Windows console. |
| 4399 | + * </p> |
| 4400 | + * |
| 4401 | + * <p><strong>Remarks</strong></p> |
| 4402 | + * <p> |
| 4403 | + * When a thread is created, the thread user interface language setting is empty and the user interface for |
| 4404 | + * the thread is displayed in the user-selected language. This function enables the application to change |
| 4405 | + * the user interface language for the current running thread. |
| 4406 | + * </p> |
| 4407 | + * <p> |
| 4408 | + * Windows Vista and later: Calling this function and specifying 0 for the language identifier is identical |
| 4409 | + * to calling SetThreadPreferredUILanguages with the MUI_CONSOLE_FILTER flag set. If the application specifies |
| 4410 | + * a valid nonzero language identifier, the function sets a particular user interface language for the thread. |
| 4411 | + * </p> |
| 4412 | + * |
| 4413 | + * @param LangId Language identifier for the user interface language for the thread. |
| 4414 | + * |
| 4415 | + * @return Returns the input language identifier if successful. |
| 4416 | + * If the input identifier is nonzero, the function returns that value. |
| 4417 | + * If the language identifier is 0, the function always succeeds and returns |
| 4418 | + * the identifier of the language that best supports the Windows console. |
| 4419 | + * |
| 4420 | + * @see <a href="https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-setthreaduilanguage">SetThreadUILanguage</a> |
| 4421 | + */ |
| 4422 | + int SetThreadUILanguage(int LangId); |
| 4423 | + |
| 4424 | + /** |
| 4425 | + * Sets the thread preferred UI languages for the current thread. |
| 4426 | + * @see <a href="https://learn.microsoft.com/en-us/windows/win32/intl/user-interface-language-management">User Interface Language Management</a> |
| 4427 | + * |
| 4428 | + * @param dwFlags Flags identifying format and filtering for the languages to set. |
| 4429 | + * |
| 4430 | + * <p> |
| 4431 | + * The following format flags specify the language format to use for the thread preferred UI languages. |
| 4432 | + * The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME. |
| 4433 | + * </p> |
| 4434 | + * <p> |
| 4435 | + * We recommend that you use MUI_LANGUAGE_NAME instead of MUI_LANGUAGE_ID. |
| 4436 | + * </p> |
| 4437 | + * |
| 4438 | + * @param pwszLanguagesBuffer Pointer to a double null-terminated multi-string buffer that contains an ordered, |
| 4439 | + * null-delimited list, in the format specified by dwFlags. |
| 4440 | + * <p> |
| 4441 | + * To clear the thread preferred UI languages list, an application sets this parameter to a null string or an empty |
| 4442 | + * double null-terminated string. If an application clears a language list, it should specify either a format flag |
| 4443 | + * or 0 for the dwFlags parameter. |
| 4444 | + * </p> |
| 4445 | + * |
| 4446 | + * @param pulNumLanguages Pointer to the number of languages that the function has set in the thread preferred UI languages list. |
| 4447 | + * When the application specifies one of the filtering flags, the function must set this parameter to NULL. |
| 4448 | + * |
| 4449 | + * @return Returns {@code true} if the function succeeds or {@code false} otherwise. |
| 4450 | + */ |
| 4451 | + boolean SetThreadPreferredUILanguages(int dwFlags, String[] pwszLanguagesBuffer, IntByReference pulNumLanguages); |
| 4452 | + |
| 4453 | + /** |
| 4454 | + * Returns the language identifier of the first user interface language for the current thread. |
| 4455 | + * |
| 4456 | + * @return Returns the identifier for a language explicitly associated with the thread by SetThreadUILanguage or |
| 4457 | + * SetThreadPreferredUILanguages. Alternatively, if no language has been explicitly associated with the |
| 4458 | + * current thread, the identifier can indicate a user or system user interface language. |
| 4459 | + */ |
| 4460 | + int GetThreadUILanguage(); |
4390 | 4461 | }
|
0 commit comments