Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Macros | Functions
win_lcid.cpp File Reference
#include <windows.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define BUFFER_SIZE   512
 

Functions

BOOL CALLBACK MyFuncLocaleEx (LPWSTR pStr, DWORD dwFlags, LPARAM lparam)
 
int main (int argc, wchar_t *argv[])
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   512

Definition at line 10 of file win_lcid.cpp.

Function Documentation

◆ main()

int main ( int  argc,
wchar_t *  argv[] 
)

Definition at line 35 of file win_lcid.cpp.

35 {
36 EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, nullptr, nullptr);
37}
BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam)
Definition win_lcid.cpp:11

◆ MyFuncLocaleEx()

BOOL CALLBACK MyFuncLocaleEx ( LPWSTR  pStr,
DWORD  dwFlags,
LPARAM  lparam 
)

Definition at line 11 of file win_lcid.cpp.

11 {
12 WCHAR wcBuffer[BUFFER_SIZE];
13 int bufferSize;
14
15 bufferSize = GetLocaleInfoEx(pStr, LOCALE_SENGLANGUAGE, wcBuffer, BUFFER_SIZE);
16 if (bufferSize == 0) {
17 wprintf(L"Locale %s had error %d\n", pStr, GetLastError());
18 return (TRUE);
19 }
20
21 LCID lcid = LocaleNameToLCID(pStr, nullptr);
22 if (lcid == 0) {
23 wprintf(L"Error %d getting LCID\n", GetLastError());
24 return (TRUE);
25 }
26
27 if (lcid > 0x8000) {
28 wprintf(L"//");
29 }
30 wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer);
31
32 return (TRUE);
33}
#define BUFFER_SIZE
Definition win_lcid.cpp:10
WINBASEAPI _Check_return_ _Post_equals_last_error_ DWORD WINAPI GetLastError(VOID)