Windows NT ( 2)



         

SETLOCAL - 3


// WndProc_OnCommand

// -----------------------------------------------------

#pragma warning(disable: 4098)

void WndProc_OnCommand(HWND hWnd, int id,

HWND hwndCtl, UINT codeNotify)

{

char szBuf[1024];

char szBuf1[1024];

char szKbLayoutName[KL_NAMELENGTH];

BOOL fRc;

switch (id)

{

case ID_FILE_EXIT:

{

//

PostQuitMessage(0);

return 0L;

break;

}

//

case ID_LOCALINFO_SETENGLISH:

{

//

fRc = SetThreadLocale(MAKELCID(

MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL),

SORT_DEFAULT));

//

if(fRc == FALSE)

{

wsprintf(szBuf1,"SetThreadLocale: Error %ld\n",

GetLastError());

MessageBox(hWnd, szBuf1, "Error", MB_OK);

}

break;

}

//

case ID_LOCALINFO_SETRUSSIAN:

{

fRc = SetThreadLocale(MAKELCID(

MAKELANGID(LANG_RUSSIAN, SUBLANG_NEUTRAL),

SORT_DEFAULT));

if(fRc == FALSE)

{

wsprintf(szBuf1,"SetThreadLocale: Error %ld\n",

GetLastError());

MessageBox(hWnd, szBuf1, "Error", MB_OK);

}

break;

}

//

//

case ID_LOCALINFO_GETLOCALINFO:

{

//

strcpy(szBuf, "LOCALE_SLANGUAGE: ");

GetLocaleInfo(

GetThreadLocale(), LOCALE_SLANGUAGE, szBuf1, 512);

strcat(szBuf, szBuf1);

//

strcat(szBuf, "\nLOCALE_ICOUNTRY: ");

GetLocaleInfo(

GetThreadLocale(), LOCALE_ICOUNTRY, szBuf1, 512);