string CProgStatusBar::GetUIVersion()
{
	string strRet = "";
	char szAppFullPath[_MAX_PATH] = {0};

	GetModuleFileName(NULL,szAppFullPath,MAX_PATH);//得到程序模块名称,全路径

	//获取当前文件的版本信息
	DWORD dwLen = GetFileVersionInfoSize(szAppFullPath,NULL); 
	char *pszAppVersion = new char[dwLen+1];
	if(pszAppVersion)
	{
		memset(pszAppVersion,0,sizeof(char)*(dwLen+1));
		GetFileVersionInfo(szAppFullPath,NULL,dwLen,pszAppVersion);
		CString strVersion;
		UINT nLen(0);
		VS_FIXEDFILEINFO *pFileInfo(NULL);
		VerQueryValue(pszAppVersion,"\\",(LPVOID*)&pFileInfo,&nLen);
		if(pFileInfo)
		{
			//获取版本号
			strRet = strprintf("%d.%d.%d.%d",HIWORD(pFileInfo->dwFileVersionMS),
				LOWORD(pFileInfo->dwFileVersionMS),
				HIWORD(pFileInfo->dwFileVersionLS),
				LOWORD(pFileInfo->dwFileVersionLS));
		}
	}
	delete pszAppVersion;
	return strRet;
}
Exemple #2
0
VOID CDUIProgressBarBase::GetProgressRect(const RECT& rtTotal, RECT& rt)
{
	INT nPos = m_nPos;
	DUI_ASSERT(nPos >= m_nMin && nPos <= m_nMax);
	DUI_ASSERT(m_nMin <= m_nMax);

	if(m_nMin > m_nMax) m_nMax = m_nMin;
	if(nPos < m_nMin) nPos = m_nMin;
	if(nPos > m_nMax) nPos = m_nMax;
	if(m_nMin == m_nMax)
	{
		DUI_ASSERT(FALSE);
		rt.left = rt.right = rtTotal.left;
		rt.bottom = rt.top = rtTotal.top;
		return;
	}


	INT nLen(0);
	rt = rtTotal;
	if(!IsVertical())
	{
		double dbRadio = (m_nPos - (double)m_nMin) / (m_nMax - m_nMin);
		nLen = (INT)(dbRadio * (rtTotal.right - rtTotal.left));
		rt.right = rt.left + nLen;
	}
	else
	{
		double dbRadio = (m_nPos - (double)m_nMin) / (m_nMax - m_nMin);
		nLen = (INT)(dbRadio * (rtTotal.bottom - rtTotal.top));
		//rt.bottom = rt.top + nLen;
		rt.top = rt.bottom - nLen;
	}
}
Exemple #3
0
const wxString mainApp::FormatWindowTitle(
  const wxString &fileName,
  bool bModified,
  const CParmOsiris *pParm,
  const wxDateTime *pTime)
{
  wxString s;
  wxString sRtn;
  if(!fileName.IsEmpty())
  {
    wxFileName fn(fileName);
    s = fn.GetFullName();
  }
  size_t nLen(s.Len());
  sRtn.Alloc(nLen + 16);
  sRtn = "OSIRIS";
  if(s.Len())
  {
    sRtn.Append(" - ");
    sRtn.Append(s);
    if(bModified)
    {
      sRtn.Append(" *");
    }
  }
  if(pParm != NULL)
  {
    sRtn.Append("; ");
    sRtn.Append(pParm->GetKitName());
    sRtn.Append(", ");
    sRtn.Append(pParm->GetLsName());
  }
  if(pTime != NULL)
  {
    sRtn.Append(" on ");
    sRtn.Append(nwxString::FormatDateTime(*pTime));
  }
  return sRtn;
}