MsoGetUILcid Function
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Returns the locale identifier (LCID) that is currently in use by Microsoft Office.
LCID __stdcall MsoGetUILcid (void);
Return Value
The locale identifier that is currently in use by Microsoft Office. If the function cannot find the locale identifier, or fails, it returns zero.
Remarks
The locale identifier indicates which language settings are currently in use in Microsoft Office. You can use the locale identifier so that the user interface of your application uses the same locale as Microsoft Office. For more information about locales, see Locales and Languages.
Requirements
Minimum supported application |
2007 Microsoft Office system |
Header |
None |
Library |
None |
DLL |
Mso.dll |
Example
The following example demonstrates how to call the MsoGetUILcid function if Mso.dll is installed in the C:\Program Files\Common Files\Microsoft Shared\Office12\ folder.
#include "stdafx.h"
#include "windows.h"
typedef LCID (__stdcall *PfnMsoGetUILcid) (void);
int _tmain(int argc, _TCHAR* argv[])
{
LCID lcid = 0;
PfnMsoGetUILcid pfnMsoGetUILcid = NULL;
HMODULE hModule = LoadLibraryW(L"C:\\Program Files\\Common Files\\microsoft shared\\OFFICE12\\mso.dll");
if (hModule)
{
pfnMsoGetUILcid = (PfnMsoGetUILcid) GetProcAddress(hModule, "_MsoGetUILcid@0");
if (pfnMsoGetUILcid)
{
lcid = pfnMsoGetUILcid();
printf("_MsoGetUILcid@0 returned %d \r\n", lcid);
}
// This ordinal value is correct only for the 2007 Microsoft Office system.
pfnMsoGetUILcid = (PfnMsoGetUILcid) GetProcAddress(hModule, (LPCSTR)1378);
if (pfnMsoGetUILcid)
{
lcid = pfnMsoGetUILcid();
printf("Ordinal function 1378 returned %d \r\n", lcid);
}
}
return 0;
}