Beispiel #1
0
void	loadString(int resource,char* buffer,size_t b_size) {
	int		r_diff = -1000;

	buffer[0] = 0;

	if( (GetUserDefaultLangID() & 0x3ff ) == LANG_POLISH )
		r_diff = 0;
	else if( (GetUserDefaultLangID() & 0x3ff ) == LANG_FRENCH )
		r_diff = 1000;
	
	LoadString(NULL,resource + r_diff,buffer,b_size);		
}
Beispiel #2
0
void	changeTitle(HWND dialog,int item,int resource) {
	char	buffer[2000];
	int		r_diff = -1000;

	if( (GetUserDefaultLangID() & 0x3ff ) == LANG_POLISH )
		r_diff = 0;
	else if( (GetUserDefaultLangID() & 0x3ff ) == LANG_FRENCH )
		r_diff = 1000;
	
	if( LoadString(NULL,resource + r_diff,buffer,sizeof buffer) )
		SendMessage(GetDlgItem (dialog, item),WM_SETTEXT,0,LPARAM(buffer));
}
Beispiel #3
0
STDMETHODIMP CUUEngine::LastOSError(long *errNo, VARIANT *errMessage, BOOL *gotErr)
{

	long lasterr;
	char *syserr;

	if ((lasterr = ::GetLastError()) == 0)
	{
		*gotErr = FALSE;
		return(S_OK);
	}

	MString erm;

	if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY,
					  NULL, lasterr, GetUserDefaultLangID(), (LPTSTR) &syserr, 0, NULL) == 0)
		erm = "Unknown Error";	// Couldn't convert error number to string
	else 
	{
		erm = syserr;	// Send back converted error string
		LocalFree(syserr);		// Discard the error string after passing it on
	}

	*errNo = lasterr;			// Save it

	erm.ToBSTR(errMessage);

	::SetLastError(0);			// Make sure last error is clear

	*gotErr = TRUE;

	return S_OK;
}
BOOL CFlashInterface::OnInitDialog()
{
	CurLangID = STANDARD_LANGID;
	HKEY hKey;
  	DWORD language;
    LONG returnStatus;
	DWORD Type=REG_DWORD;
    DWORD Size=sizeof(DWORD);
    returnStatus = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\CamStudioOpenSource for Nick\\vscap\\Language", 0L, KEY_ALL_ACCESS, &hKey);

	if (returnStatus == ERROR_SUCCESS)
    {

        returnStatus = RegQueryValueEx(hKey, "LanguageID", NULL, &Type,(LPBYTE)&language, &Size);

		if (returnStatus == ERROR_SUCCESS)
        {

        	if ( !LoadLangIDDLL((int) language) )
	         if ( !LoadLangIDDLL(GetUserDefaultLangID()) )
     			LoadLangIDDLL(GetSystemDefaultLangID());
        }
     }

    RegCloseKey(hKey);

	CPropertyPage::OnInitDialog();

	int valset = int(percentLoadedThreshold * 100.0);
	if (valset > 100) valset = 100;
	if (valset < 10) valset = 10;

	UDACCEL acc[2];
    acc[0].nSec = 1;
    acc[0].nInc = 5;

	acc[1].nSec = 3;
    acc[1].nInc = 10;

	((CSpinButtonCtrl *) GetDlgItem(IDC_SPIN1))->SetBuddy(GetDlgItem(IDC_PRELOADPERCENT));
	((CSpinButtonCtrl *) GetDlgItem(IDC_SPIN1))->SetRange(10,100);
	((CSpinButtonCtrl *) GetDlgItem(IDC_SPIN1))->SetPos(valset);
	((CSpinButtonCtrl *) GetDlgItem(IDC_SPIN1))->SetAccel(2,acc);

	// TODO: Add extra initialization here
	((CEdit *)GetDlgItem(IDC_PRELOADBITMAP))->SetWindowText(loadingPath);

	local_swfbk_red = swfbk_red;
	local_swfbk_green = swfbk_green;
	local_swfbk_blue = swfbk_blue;

	CString foxStr,foyStr;
	foxStr.Format("%d",FrameOffsetX);
	foyStr.Format("%d",FrameOffsetY);
	((CEdit *) GetDlgItem(IDC_FRAMEOFFSETX))->SetWindowText(foxStr);
	((CEdit *) GetDlgItem(IDC_FRAMEOFFSETY))->SetWindowText(foyStr);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Beispiel #5
0
/*------------------------------------------------
  get locale information by ANSI
--------------------------------------------------*/
int MyGetLocaleInfoA(int ilang, int codepage,
	LCTYPE lctype, char* dst, int n)
{
	int r;
	LCID locale;
	
	*dst = 0;
	locale = MAKELCID((WORD)ilang, SORT_DEFAULT);
	
	if(GetVersion() & 0x80000000) // 95/98/Me
		r = GetLocaleInfoA(locale, lctype, dst, n);
	else  // NT4/2000/XP
	{
		WCHAR buf[80];
		r = GetLocaleInfoW(locale, lctype, buf, 80);
		if(r)
		{
			int codepage = GetCodePage(GetUserDefaultLangID());
			r = WideCharToMultiByte(codepage, 0, buf, -1, dst, n,
				NULL, NULL);
		}
	}
	
	return r;
}
LANGID CDirstatApp::GetEffectiveLangid()
{
	if (GetOptions()->IsUseWdsLocale())
		return GetLangid();
	else
		return GetUserDefaultLangID();
}
Beispiel #7
0
static void NSISCALL set_language()
{
  LANGID lang_mask=(LANGID)~0;
  LANGID lang=state_language[0]?myatoi(state_language):GetUserDefaultLangID();
  char *language_table=0;
  int lang_num;

lang_again:
  lang_num=g_blocks[NB_LANGTABLES].num;
  while (lang_num--) {
    language_table=((char*)g_blocks[NB_LANGTABLES].offset)+lang_num*g_header->langtable_size;
    if (!((lang ^ *(LANGID*)language_table) & lang_mask)) {
      dlg_offset=*(int*)(language_table+sizeof(LANGID));
      g_exec_flags.rtl=*(int*)(language_table+sizeof(LANGID)+sizeof(int));
      cur_langtable=(int*)(language_table+sizeof(LANGID)+2*sizeof(int));
      break;
    }
  }
  if (!cur_langtable) {
    if (lang_mask == (LANGID)~0)
      lang_mask=0x3ff; // primary lang
    else // we already tried once and we still don't have a language table
      lang_mask=0; // first lang
    goto lang_again;
  }

  myitoa(state_language, *(LANGID*)language_table);
  {
    char *caption = GetNSISString(g_caption,LANG_CAPTION);
#ifdef NSIS_SUPPORT_BGBG
    my_SetWindowText(m_bgwnd, caption);
#endif
  }
}
std::wstring GetBrowserLanguage()
{
  LANGID lcid = GetUserDefaultLangID();
  std::wstring lang;
  // According to http://msdn.microsoft.com/en-us/library/windows/desktop/dd373848(v=vs.85).aspx
  // The maximum number of characters allowed for this string is nine, including a terminating null character.
  {
    std::array<wchar_t, 9> localeLanguage;
    int res = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME, localeLanguage.data(), localeLanguage.size());
    if (res == 0)
    {
      DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - Failed");
    }
    else
    {
      lang += localeLanguage.data();
    }
  }
  lang += L"-";
  {
    std::array<wchar_t, 9> localeCountry;
    int res = GetLocaleInfoW(lcid, LOCALE_SISO3166CTRYNAME, localeCountry.data(), localeCountry.size());
    if (res == 0)
    {
      DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country");
    }
    else
    {
      lang += localeCountry.data();
    }
  }
  return lang;
}
int set_lang(void)
{
	unsigned int lang_usr,lang_sys,id;

	id=GetSystemDefaultLangID();
	lang_sys=PRIMARYLANGID(id);
	id=GetUserDefaultLangID();
	lang_usr=PRIMARYLANGID(id);
	if(lang_usr!=lang_sys) {
		printf("warning: user language differs from system language\r\n\r\n");
		printf("1. system : ");print_lang(lang_sys);
		printf("2. user   : "******"Select(1-2): ");
		id=getch();
	if(id!=49&&id!=50) {
		printf("wrong choice '%c', leaving.\r\n",id);
		exit(0);
		}
	if(id==49) {
		printf("system language\r\n");
		return lang_sys;
		}
	else
		printf("user language\r\n");
	}
	return lang_usr;
}
Beispiel #10
0
//-----------------------------------------------------------------------------
// Name: ShowLastError
// Object: show last windows api error
// Parameters :
//     in  :
//     out :
//     return : TRUE on success, FALSE on error
//-----------------------------------------------------------------------------
BOOL CAPIError::ShowLastError(TCHAR* szPrefix)
{
#if (defined(TOOLS_NO_MESSAGEBOX))
    UNREFERENCED_PARAMETER(szPrefix);
    return TRUE;
#else
    TCHAR pcError[MAX_PATH];
    TCHAR* pszMsg;
    DWORD dwLastError=GetLastError();
    DWORD dw=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
                           NULL,
                           dwLastError,
                           GetUserDefaultLangID(),//GetSystemDefaultLangID()
                           pcError,
                           MAX_PATH-1,
                           NULL);
    
    pszMsg=new TCHAR[_tcslen(szPrefix)+MAX_PATH+6]; // +3 for \r\n and \0
    _tcscpy(pszMsg,szPrefix);

    //If the function succeeds, the return value is the number of TCHARs stored in the output buffer,
    //  excluding the terminating null character.
    //If the function fails, the return value is zero
    if(dw!=0)
    {
        // FormatMessage is ok add error description to pszMsg
        _tcscat(pszMsg,_T("\r\n"));
        _tcscat(pszMsg,pcError);
    }
    return MessageBox(NULL,pszMsg,_T("Error"),MB_OK|MB_ICONERROR|MB_TOPMOST);

#endif
}
Beispiel #11
0
//-----------------------------------------------------------------------------
// Name: ShowLastError
// Object: show last windows api error
// Parameters :
//     in  :
//     out :
//     return : TRUE on success, FALSE on error
//-----------------------------------------------------------------------------
BOOL CAPIError::ShowLastError()
{
#if (defined(TOOLS_NO_MESSAGEBOX))
    return TRUE;
#else
    TCHAR pcError[MAX_PATH];
    DWORD dwLastError=GetLastError();
    DWORD dw=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
                           NULL,
                           dwLastError,
                           GetUserDefaultLangID(),//GetSystemDefaultLangID()
                           pcError,
                           MAX_PATH-1,
                           NULL);
    
    
    //If the function succeeds, the return value is the number of TCHARs stored in the output buffer,
    //  excluding the terminating null character.
    //If the function fails, the return value is zero
    if(dw==0)
        return FALSE;// FormatMessage failed
    else
    {
        return MessageBox(NULL,pcError,_T("Error"),MB_OK|MB_ICONERROR|MB_TOPMOST);
    }
#endif
}
Beispiel #12
0
CString Language::GetString(UINT uiID, const CString& strKey)
{
	CString strValue = _T("");

	// 使用系统语言
	if (m_strFileName.IsEmpty())
	{
		LoadLanguage(GetUserDefaultLangID());
	}

	// 使用配置文件数据
	LANG_MAP::iterator iter = m_langMap.find(strKey);
	if(m_langMap.end() != iter)
	{
		strValue = iter->second;
	}

	if(strValue.IsEmpty())
	{
		// 使用默认配置
		TCHAR tchValue[LANGUAGE_MAX_LENGTH] = {0};
		(void)::LoadString(AfxGetInstanceHandle(), uiID, tchValue, /*sizeof(TCHAR)**/LANGUAGE_MAX_LENGTH);
		strValue = tchValue;
	}

	return strValue;
}
Beispiel #13
0
char *getVersion(char *fileName)
{
    DWORD vSize;
    DWORD vLen,langD;
    BOOL retVal;

    LPVOID version=NULL;
    LPVOID versionInfo=NULL;
    static char fileVersion[256];
    bool success = true;
    vSize = GetFileVersionInfoSize(fileName,&vLen);
    if (vSize)
    {
        versionInfo = malloc(vSize+1);
        if (GetFileVersionInfo(fileName,vLen,vSize,versionInfo))
        {
            sprintf(fileVersion,"\\VarFileInfo\\Translation");
            retVal = VerQueryValue(versionInfo,fileVersion,&version,(UINT *)&vLen);
            if (retVal && vLen==4)
            {
                memcpy(&langD,version,4);
                sprintf(fileVersion, "\\StringFileInfo\\%02X%02X%02X%02X\\FileVersion",
                        (langD & 0xff00)>>8,langD & 0xff,(langD & 0xff000000)>>24,
                        (langD & 0xff0000)>>16);
            }
            else
                sprintf(fileVersion, "\\StringFileInfo\\%04X04B0\\FileVersion",
                        GetUserDefaultLangID());
            retVal = VerQueryValue(versionInfo,fileVersion,&version,(UINT *)&vLen);
            if (!retVal) success = false;
        }
Beispiel #14
0
 //================================================================================================
//--------------------------------------------------------------+++--> Create a Font For the Clock:
HFONT CreateMyFont(char* fontname, int fontsize, LONG weight, LONG italic, int angle) { //--+++-->
	LOGFONT lf;	POINT pt;	HDC hdc;	WORD langid;
	char s[11];	int cp, i;	BYTE charset; int FontQty;
	
  memset(&lf, 0, sizeof(LOGFONT));
  langid = (WORD)GetMyRegLong("Format", "Locale", (int)GetUserDefaultLangID());
  FontQty = GetMyRegLong("Clock", "FontQuality", CLEARTYPE_QUALITY);
  cp = CP_ACP;

  if(GetLocaleInfo(langid, LOCALE_IDEFAULTANSICODEPAGE, s, 10) > 0) {
	 char *p;
	 p = s;
	 cp = 0;
	 while('0' <= *p && *p <= '9') cp = cp * 10 + *p++ - '0';
	 if(!IsValidCodePage(cp)) cp = CP_ACP;
  }
	
  charset = 0;
  for(i = 0; codepage_charset[i].cp; i++) {
	  if(cp == codepage_charset[i].cp) {
		 charset = codepage_charset[i].charset; break;
	  }
  }
	
  hdc = GetDC(NULL);
	
	// find a font named "fontname"
  if(charset == 0) charset = GetTextCharset(hdc);
  lf.lfCharSet = charset;
  if(EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontFamExProc, (LPARAM)fontname, 0)) {
	 lf.lfCharSet = OEM_CHARSET;
	 if(EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontFamExProc, (LPARAM)fontname, 0)) {
		lf.lfCharSet = ANSI_CHARSET;
		EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontFamExProc, (LPARAM)fontname, 0);
	 }
  }
	
	pt.x = 0;
	pt.y = MulDiv(fontsize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
	DPtoLP(hdc, &pt, 1);
	lf.lfHeight = -pt.y;
	
	ReleaseDC(NULL, hdc);
	
	lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0;
	lf.lfWeight = weight;
	lf.lfItalic = (BYTE)italic;
	lf.lfUnderline = 0;
	lf.lfStrikeOut = 0;
	if(angle >0) lf.lfEscapement = angle;
	lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
	lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;

	lf.lfQuality = FontQty; // This Just HAD To be Adjustable.

	lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
	strcpy(lf.lfFaceName, fontname);
	
 return CreateFontIndirect(&lf);
}
Beispiel #15
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) {
	hInst = hInstance;
	
	HiconDLG = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON2), IMAGE_ICON, 128, 128, 0);

	hMainDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MAINDLG), (HWND)NULL, MainDlgProc);
	if(!hMainDlg) return false;
	
	HICON HiconDLGico = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
	SetClassLong(hMainDlg, GCL_HICON, (LONG) HiconDLGico);

	// Переводит диалоговое окно на русский если язык операционной системы русский
	if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_RUSSIAN){
		SetWindowText(hMainDlg, Utf8_to_cp1251("Metin2 лаунчер").c_str());
		SetDlgItemText(hMainDlg, IDC_BUTTON, Utf8_to_cp1251("Запуск").c_str());
		SetDlgItemText(hMainDlg, IDC_BUTTON2, Utf8_to_cp1251("Запуск с AntiDDoS").c_str());
		SetDlgItemText(hMainDlg, IDC_BUTTON3, Utf8_to_cp1251("Запуск прокси сервера").c_str());
	}
	
	MSG msg;
	while (GetMessage(&msg, NULL, NULL, NULL)) {
		if (!IsWindow(hMainDlg) || !IsDialogMessage(hMainDlg, &msg)) {
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}	// if (!IsWindow(hMainDlg) || !IsDialogMessage(hMainDlg, &msg))
	}	// while (GetMessage(&msg, NULL, NULL, NULL))
	
	return true;
	DestroyIcon(HiconDLGico);
	DestroyIcon(HiconDLG);
}
Beispiel #16
0
BOOL GetStringTableValue(void *pBlock, LangAndCodePage *plcp, UINT nItems,
                         const TCHAR *szVersionInfo, TCHAR *szVersionBuffer, UINT cchMax)
{
    BOOL bSuccess = FALSE;
    LANGID UserLangId = GetUserDefaultLangID();

    for(UINT i = 0; i < nItems; i++)
    {
        /* If the bottom eight bits of the language id's match, use this
        version information (since this means that the version information
        and the users default language are the same). Also use this version
        information if the language is not specified (i.e. wLanguage is 0). */
        if((plcp[i].wLanguage & 0xFF) == (UserLangId & 0xFF) ||
                plcp[i].wLanguage == 0)
        {
            TCHAR szSubBlock[64];
            StringCchPrintf(szSubBlock, SIZEOF_ARRAY(szSubBlock),
                            _T("\\StringFileInfo\\%04X%04X\\%s"), plcp[i].wLanguage,
                            plcp[i].wCodePage, szVersionInfo);

            TCHAR *szBuffer;
            UINT uLen;
            BOOL bRet = VerQueryValue(pBlock, szSubBlock, reinterpret_cast<LPVOID *>(&szBuffer), &uLen);

            if(bRet && (uLen > 0))
            {
                StringCchCopy(szVersionBuffer, cchMax, szBuffer);
                bSuccess = TRUE;
                break;
            }
        }
    }

    return bSuccess;
}
Beispiel #17
0
/*------------------------------------------------
  when the clock is right-clicked
  show pop-up menu
--------------------------------------------------*/
void OnContextMenu(HWND hwnd, HWND hwndClicked, int xPos, int yPos)
{
	WIN32_FIND_DATA fd;
	HANDLE hfind;
	TPMPARAMS tpmp;
	LPTPMPARAMS lptpmp = NULL;
	
	SendOnContextMenu();
	
	if(m_tcmenutxt[0] == 0 || !IsFile(m_tcmenutxt))
	{
		// common/tclang.c
		FindFileWithLangCode(m_tcmenutxt, GetUserDefaultLangID(), TCMENUTXT);
	}
	
	hfind = FindFirstFile(m_tcmenutxt, &fd);
	if(hfind != INVALID_HANDLE_VALUE)
	{
		FindClose(hfind);
		if(m_lasttime != fd.ftLastWriteTime.dwLowDateTime)
		{
			EndContextMenu();
			m_lasttime = fd.ftLastWriteTime.dwLowDateTime;
		}
	}
	else m_lasttime = 0;
	
	// create popup menu and append items from tcmenu.txt
	if(!m_hMenu)
	{
		m_hMenu = CreatePopupMenu();
		if(hfind != INVALID_HANDLE_VALUE)
			LoadMenuFromText(m_hMenu, m_tcmenutxt, &fd);
		else
			LoadMenuFromText(m_hMenu, NULL, NULL);
	}
	
	CheckMenu(m_hMenu);
	
	// get keyboard input
	SetFocusTClockMain(hwnd);
	
	// APP key
	if((xPos == -1) && (yPos == -1))
	{
		tpmp.cbSize = sizeof(tpmp);
		lptpmp = &tpmp;
		GetWindowRect(g_hwndClock, &tpmp.rcExclude);
		xPos = tpmp.rcExclude.right;
		yPos = tpmp.rcExclude.top;
	}
	
	// open popup menu
	TrackPopupMenuEx(m_hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON,
		xPos, yPos, hwnd, lptpmp);
	
	PostMessage(hwnd, WM_NULL, 0, 0);
}
Beispiel #18
0
//---------------------------------------------------------------------------------------
void GetLangTLA(TCHAR szLang[], int nSize)
{
   short nLangID = GetUserDefaultLangID();
   short nPrimaryLangID = PRIMARYLANGID(nLangID);

   if(nPrimaryLangID == LANG_ENGLISH)
      _tcsncpy_s(szLang, nSize, _T("ENU"), _TRUNCATE);
   else
      _tcsncpy_s(szLang, nSize, _T("ENU"), _TRUNCATE);
}
Beispiel #19
0
L004014AC()
{
	/* unknown */ void  ebp;



    (save)edi;
    L004012A4(GetUserDefaultLangID(), edx, ebx, esi);
    (restore)edi;
    return(GetCurrentThread());
}
Beispiel #20
0
L00401308()
{
	/* unknown */ void  ebp;
	/* unknown */ void  edi;



    L00401288(eax, ebx, eax, edx);
    GetUserDefaultLangID();
    return(GetCurrentThread());
}
Beispiel #21
0
L00401408()
{
	/* unknown */ void  ebp;



    (save)edi;
    L004010D8(GetCurrentProcessId(), ecx, ecx, esi);
    (restore)edi;
    return(GetUserDefaultLangID());
}
Beispiel #22
0
L004012EC()
{
	/* unknown */ void  ebp;
	/* unknown */ void  edi;



    L00401370(edx, ebx, edx, ebx);
    GetUserDefaultLangID();
    return(GetFocus());
}
Beispiel #23
0
L0040155C()
{
	/* unknown */ void  ebp;



    GetSystemDefaultLCID();
    (save)edi;
    L0040138C(ecx, ecx, edx);
    (restore)edi;
    return(GetUserDefaultLangID());
}
Beispiel #24
0
L00401288()
{
	/* unknown */ void  ebp;



    GetCurrentProcessId();
    (save)edi;
    L004010F8(ecx, ebx);
    (restore)edi;
    return(GetUserDefaultLangID());
}
Beispiel #25
0
////////////////////////////////////////////////////////////////////////////////
// GetMesageDll -- find and load the message DLL. Returns 0 if the message
// DLL could not be located or loaded. The message DLL should be either in a 
// subdirectory whose name is a language id, or in the current directory. We have
// a complex set of rules to figure out which language ids to try.
HINSTANCE WINAPI GetALinkMessageDll ()
{
    LANGID langid;

    if (! hModuleMessages) {
        HINSTANCE hModuleMessagesLocal = 0;


        // Next try current locale.
        if (!hModuleMessagesLocal) {
            langid = LANGIDFROMLCID(GetThreadLocale());
            hModuleMessagesLocal = FindMessageDll(langid);
            if (!hModuleMessagesLocal)
                hModuleMessagesLocal = FindMessageDll(MAKELANGID(PRIMARYLANGID(langid), SUBLANG_DEFAULT));
        }

        // Next try user and system locale.
        if (!hModuleMessagesLocal) {
            langid = GetUserDefaultLangID();
            hModuleMessagesLocal = FindMessageDll(langid);
        }
        if (!hModuleMessagesLocal) {
            langid = GetSystemDefaultLangID();
            hModuleMessagesLocal = FindMessageDll(langid);
        }

        // Next try current directory.
        if (!hModuleMessagesLocal) 
            hModuleMessagesLocal = FindMessageDll((LANGID)-1);

        // Try a fall-back list of locales.
        if (!hModuleMessagesLocal) {
            for (unsigned int i = 0; i < lengthof(g_fallbackLangs); ++i) {
                langid = g_fallbackLangs[i];
                hModuleMessagesLocal = FindMessageDll(langid);
                if (hModuleMessagesLocal)
                    break;
            }
        }

        if (hModuleMessagesLocal)
        {
            if (InterlockedCompareExchangePointer( (void**)&hModuleMessages, hModuleMessagesLocal, NULL)) {
                ASSERT(hModuleMessages != hModuleMessagesLocal);
                PAL_FreeSatelliteResource(hModuleMessagesLocal);
            } else
                ASSERT(hModuleMessagesLocal == hModuleMessages);
        }

    }
    return hModuleMessages;
}
Beispiel #26
0
L004011E8()
{
	/* unknown */ void  ebp;



    GetUserDefaultLangID();
    (save)edi;
    eax = L004010A0(ebx, esi);
    (restore)edi;
    edx = edi + 2708;
    do {
        GetModuleHandleW(edx);
    } while(eax != 0);
}
Beispiel #27
0
/*-------------------------------------------
  initialize
---------------------------------------------*/
void InitTCPlayer(void)
{
	GetModuleFileName(g_hInst, g_mydir, MAX_PATH);
	del_title(g_mydir);
	strcpy(g_inifile, g_mydir);
	add_title(g_inifile, "tclock.ini");
	g_bIniSetting = TRUE;
	
	// common/langcode.c
	FindFileWithLangCode(g_langfile, GetUserDefaultLangID(), TCLANGTXT);
	g_hfontDialog = CreateDialogFont();
	
	g_hwndClock = GetClockWindow();
	
	SetOnContextMenu();
}
Beispiel #28
0
void CVideoPane::SetLanguage(int ilang)
{
	int iLangId = GetUserDefaultLangID();
	
	switch (ilang)
	{
	case eLTE_LANG_zh_CN:
		{
			iLangId = 2052;	// 中文
		}
		break;
	case eLTE_LANG_en_US:
		{
			iLangId = 1033;	// 英文
		}
		break;
	case eLTE_LANG_es_ES:
		{
			iLangId = 1034;	// 西班牙
		}
		break;
	default:
		{

		}
		break;
	}
	m_Language.LoadLanguage(iLangId);

	// 刷新提示文本
	if (NULL != m_hWnd)
	{
		m_SnapshotBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_SNAPSHOT)));
		m_ReversePlayBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_REVERSEPLAY)));
		m_AudioBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_UNMUTE)));
		m_FullScreenBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_FULLSCREEN)));
		m_CloseBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_CLOSEVIDEO)));
		if (m_bHaveSound)
		{
			m_AudioBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_MUTE)));
		}
		else
		{
			m_AudioBtn.UpdateToolTip(m_Language.GetString(GET_STRING_PARAM(IDS_UNMUTE)));
		}
	}
}
Beispiel #29
0
//---------------------------------------------------------------------------
void TForm1::set_language()
{
	LANGID id;

	id = GetUserDefaultLangID();

	if(id == 0x0411){
		this->Label1->Font->Charset = DEFAULT_CHARSET;
		this->Label1->Font->Name = "MS ゴシック";
		
		this->Font->Charset = DEFAULT_CHARSET;
		this->Font->Name = "MS ゴシック";

		this->Caption = "MPEG-2 VIDEO VFAPI Plug-In 設定";
		this->Label1->Caption = "MPEG-2 VIDEO VFAPI Plug-In 設定";
		this->GroupBox5->Caption = "アスペクト比";
		this->GroupBox1->Caption = "YUV → RGB 変換";
		this->GroupBox2->Caption = "IDCT 関数";
		this->GroupBox3->Caption = "CPU 拡張";
		this->GroupBox4->Caption = "フィールド順";
		this->GroupBox6->Caption = "色空間行列(省略時)";
		this->GroupBox7->Caption = "GOP リスト";
		this->GroupBox8->Caption = "連番ファイル";
		this->GroupBox9->Caption = "YUY2 色空間行列 (m2v.aui 用)";
		this->ignore_aspect_ratio->Caption = "無視";
		this->use_aspect_ratio->Caption = "反映";
		this->no_remap->Caption = "ストレート変換";
		this->remap->Caption = "ITU-R BT.601 から伸張";
		this->idct_double->Caption = "浮動小数点";
		this->idct_llm->Caption = "整数 (32bit LLM)";
		this->idct_ap922->Caption = "整数 (32bit AP-922)";
		this->keep_frame->Caption = "ソースフレームを維持";
		this->top_first->Caption = "トップ→ボトム順で出力";
		this->bottom_first->Caption = "ボトム→トップ順で出力";
		this->color_matrix->Items->Strings[0] = "自動認識(解像度から)";
		this->yuy2_matrix->Items->Strings[0] = "元の YUV データを維持";
		this->never_use_timecode->Caption = "GOP タイムコードを使わない";
		this->never_save_gl_file->Caption = "GL ファイルを保存しない";
		this->open_multi_file->Caption = "結合して開く";
		this->open_single_file->Caption = "指定ファイルのみ開く";
		this->Button1->Caption = "決定";
		this->Button2->Caption = "取り消し";
		this->Button3->Caption = "削除";
	}
}
Beispiel #30
0
QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const
{
    if(script == QUnicodeTables::Common) {
//            && !(request.styleStrategy & QFont::NoFontMerging)) {
        QFontDatabase db;
        if (!db.writingSystems(family).contains(QFontDatabase::Symbol)) {
            if(!tryFonts) {
                LANGID lid = GetUserDefaultLangID();
                switch( lid&0xff ) {
                case LANG_CHINESE: // Chinese (Taiwan)
                    if ( lid == 0x0804 ) // Taiwan
                        tryFonts = ch_TW_tryFonts;
                    else
                        tryFonts = ch_CN_tryFonts;
                    break;
                case LANG_JAPANESE:
                    tryFonts = jp_tryFonts;
                    break;
                case LANG_KOREAN:
                    tryFonts = kr_tryFonts;
                    break;
                default:
                    tryFonts = other_tryFonts;
                    break;
                }
            }
            QStringList list;
            const char **tf = tryFonts;
            while(tf && *tf) {
                if(m_families.contains(QLatin1String(*tf)))
                    list << QLatin1String(*tf);
                ++tf;
            }
            if (!list.isEmpty())
                return list;
        }
    }
    QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script);
    if (!result.isEmpty())
        return result;
    if (QWindowsContext::verboseFonts)
        qDebug() << __FUNCTION__ << family << style << styleHint
                 << script << result << m_families;
    return result;
}