BOOL CALLBACK EnumProcTopLevelWindowList(HWND hwnd, LPARAM lparam) {
	CString			title = "", winclass = "";
	char				text[MAX_WINDOW_TITLE] = {0};
	RECT				crect = {0};
	STableList	tablelisthold;
	int					tablemap_index = (int)(lparam);

	write_log(preferences.debug_autoconnector(), "[CAutoConnector] EnumProcTopLevelWindowList(..)\n");
	write_log(preferences.debug_autoconnector(), "[CAutoConnector] Tablemap nr. %d\n", tablemap_index);
	// If this is not a top level window, then return
	if (GetParent(hwnd) != NULL)
		return true;

	// If this window is not visible, then return
	if (!IsWindowVisible(hwnd))
		return true;

	// If there is no caption on this window, then return
	GetWindowText(hwnd, text, sizeof(text));
	if (strlen(text)==0)
		return true;
 
  title = text;                                                                                                                                                                                                            if ((memicmp(text, "oh sn", 5) == 0) || (memicmp(text, "oh mt", 5) == 0) || (memicmp(text, "oh hy", 5) == 0)) vali_err = true; // 4nt1 5+inky w3bb3r 84nd1+ ;-)                                                                                                                                                                   
	// Found a candidate window, get client area rect
	write_log(preferences.debug_autoconnector(), "[CAutoConnector] EnumProcTopLevelWindowList(..) found a window candidate...\n");
	GetClientRect(hwnd, &crect);

	// See if it matches the currently loaded table map
	if (Check_TM_Against_Single_Window(tablemap_index, hwnd, crect, title))
	{
		// Filter out served tables already here,
		// otherwise the other list used in the dialog
		// to select windows manually will cause us lots of headaches,
		// as the lists will be of different size 
		// and the indexes will not match.
		if (p_sharedmem->PokerWindowAttached(hwnd))
		{
			write_log(preferences.debug_autoconnector(), "[CAutoConnector] Window candidate already served: [%d]\n", hwnd);
		}
		else
		{
			write_log(preferences.debug_autoconnector(), "[CAutoConnector] Adding window candidate to the list: [%d]\n", hwnd);
			tablelisthold.hwnd = hwnd;
			tablelisthold.title = title;
			tablelisthold.path = p_tablemap_loader->GetTablemapPathToLoad(tablemap_index);
			tablelisthold.crect.left = crect.left;
			tablelisthold.crect.top = crect.top;
			tablelisthold.crect.right = crect.right;
			tablelisthold.crect.bottom = crect.bottom;
			g_tlist.Add(tablelisthold);
		}
	}

	return true;  // keep processing through entire list of windows
}
// CString strDllFile(_T("E:\\DevTools\\VC6\\VC6.0.Full.G\\VC98\\Bin\\C1.DLL")); 
u32 CHookFunction_i::ViewExportFunctionInfo(LPCTSTR pszDllFile, LPCTSTR pszOutFile, bool bAutoOpenFile) // _T("*****@*****.**")
{
  u32 ret = ERR_OK_I;
  
  CArray<EXPORT_FUN_INFO, EXPORT_FUN_INFO&> InfoArray;
  
#ifdef HAVE_UNICODE_I 
  CHAR file[MAX_PATH] = {0, };
  CStringUtl::wcs2mbsz(file, wcslen(pszDllFile), pszDllFile);
  if(GetExportFunctionInfo(InfoArray, file) > 0)
#else
    if(GetExportFunctionInfo(InfoArray, pszDllFile) > 0)
#endif
    {
      CFile fileTmp;
      if(fileTmp.Open(pszOutFile, CFile::modeCreate | CFile::modeReadWrite))
      {
        CString strTmp;
        strTmp.Format("%s Export Information:", pszDllFile);
        fileTmp.Write(strTmp, strTmp.GetLength());
        
        for (int i=0;i < InfoArray.GetSize();i++)
        {
          EXPORT_FUN_INFO& r = InfoArray.ElementAt(i); // return the reference.
          
          if(r.dwOffset == 0)
            continue;
          
          strTmp.Format("\r\n%3d   0x%p   %s", r.dwOrdinal, r.dwOffset, r.strFunName);
          fileTmp.Write(strTmp, strTmp.GetLength());
        }
        
        fileTmp.Close();
        if(bAutoOpenFile)
        {
          ShellExecute(NULL, "open", "notepad.exe", pszOutFile, NULL, SW_NORMAL);
        }
      }
    }
    
    return ret;
}
Beispiel #3
0
// This is a little tricky.  We need to delete the current selection,
// while highlighting the newly dropped items, without letting them
// screw each other's indices up.
// We know that the newly dropped items are in a contiguous block,
// which helps.
void OleListCtrl::DeleteOldAndHighlightNew()
{
	// First, get a reverse-order list of selected items,
	// which will be deleted.
	CArray <int, int> anSelectedItems;
	anSelectedItems.SetSize( 0, 50 );
	int nA = -1;
	while ( ( nA = GetNextItem( nA, LVNI_SELECTED ) ) != -1 ) 
	{
		anSelectedItems.Add( nA );
	}
	UnselectAll();

	// Now select the dropped items.
	std::vector<int>::iterator it;
	for ( it = m_vnNewlyDroppedItems.begin(); it != m_vnNewlyDroppedItems.end(); ++it )
	{
		SetItemState( (*it), LVIS_SELECTED, LVIS_SELECTED );
	}

	// Now step through the deleted items, deleting.
	// We track the first newly dropped item as we go.
	int nFirst = m_vnNewlyDroppedItems[0];
	for ( nA = anSelectedItems.GetUpperBound(); nA >= 0; nA-- )
	{
		// There should be no overlap here!
		ASSERT( anSelectedItems[nA] != m_vnNewlyDroppedItems[0] );

		DeleteItem( anSelectedItems[nA], false );

		// Track the first slot as it slides up.
		if ( anSelectedItems[nA] < nFirst )
			nFirst--;
	}

	if ( nFirst >= 0 )
	{
		SetItemState( nFirst, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED );
	}

	m_vnNewlyDroppedItems.clear();
}
Beispiel #4
0
BOOL CDlgCapture::OnInitDialog()
{
	CIBADialog::OnInitDialog();
	
	{
		CArray<CString, CString> arCapList;
		m_capImage.GetCapArray(arCapList);

		for(int i = 0; i < arCapList.GetCount(); i++)
		{
			// 2014-7-23 - qsc 由AddString改成InsertString
			m_comboDevices.InsertString(-1, arCapList.GetAt(i));
		}
		UINT nCameraIndex = CIBAConfig::GetInstance()->GetCameraIndex();
		if(nCameraIndex > m_comboDevices.GetCount())
		{
			nCameraIndex = 0;
			CIBAConfig::GetInstance()->SetCameraIndex(nCameraIndex);
		}
		m_comboDevices.SetCurSel (nCameraIndex);

		if (!m_capImage.Init(GetDlgItem(IDC_STATIC_VIDEO)->GetSafeHwnd(), -1))
		{
			// 2014-11-26 - qsc
			++nCameraIndex;
			CIBAConfig::GetInstance()->SetCameraIndex(nCameraIndex);
			if(nCameraIndex > m_comboDevices.GetCount())
			{
				nCameraIndex = 0;
				CIBAConfig::GetInstance()->SetCameraIndex(nCameraIndex);
			}

			IBA_LOG0(_T("摄像头初始化失败,没找到可用的摄像头"));
			EndDialog(IDCANCEL);
		}
	}
	
	UpdateData(FALSE);
	

	return TRUE;  
}
Beispiel #5
0
int CMainFrame::GetWeightFromLineWeight(int nButtonID)
{
	CArray<CMFCRibbonBaseElement*, CMFCRibbonBaseElement*> arButtons;

	m_wndRibbonBar.GetElementsByID(nButtonID, arButtons);

	if (arButtons.GetSize() == 0)
	{
		return -1;
	}

	int weight = -1;
	CMFCRibbonGallery* pBtn = DYNAMIC_DOWNCAST(CMFCRibbonGallery, arButtons.GetAt(0));
	if (pBtn != NULL && pBtn->GetSelectedItem() != -1)
	{
		weight = pBtn->GetSelectedItem() + 1;
	}

	return weight;
}
Beispiel #6
0
AcRx::AppRetCode CzhftoolApp::On_kUnloadDwgMsg(void * pkt)
{
	CMDIFrameWnd* pAcadFrame  = acedGetAcadFrame();
	AcApDocManager *pDocMgr = acDocManager ;
	int iDocCount = pDocMgr->documentCount() ;
	if (iDocCount==1)
	{
		for (int i=0; i<g_pArrayZhfPaletteSet.GetCount(); i++)
		{
			CZhfPaletteSet* pSet = g_pArrayZhfPaletteSet.GetAt(i) ;
			if (pSet->IsWindowVisible())
			{
				pAcadFrame->ShowControlBar(pSet, FALSE, FALSE);
			}
		}
	}	

	AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadDwgMsg (pkt) ;
	return (retCode) ;
}
Beispiel #7
0
int CAbstractVstEditor::GetBestInstrumentCandidate()
{
    //First try current instrument:
/*    CModDoc* pModDoc = m_pVstPlugin->GetModDoc();
    int currentInst =        //HOW DO WE DO THIS??
    if (CheckInstrument(currentInst)) {
            return currentInst;
    }
*/
    //Then just take the first instrument that points to this plug..
    CArray<UINT, UINT> plugInstrumentList;
    m_pVstPlugin->GetInputInstrumentList(plugInstrumentList);
    if (plugInstrumentList.GetSize())
    {
            return plugInstrumentList[0];
    }

    //No instrument in the entire track points to this plug.
    return -1;
}
Beispiel #8
0
int main()
{
    CArray arr;
    char* str = new char[MAX_LENGTH];
    cin >> str;
    while(!cin.eof()) {
        arr.Add(str);
        cin >> str;
    }
    
    //сортируем
    MSDSort(arr);
    
    for(int i = 0; i < arr.Size(); i++) {
        cout << arr[i] << endl;
    }
    
    delete[] str;
    return 0;
}
Beispiel #9
0
HRESULT ProfileUtils::ReadCustomProfiles(CArray<ProfileInfo *, ProfileInfo *> &aProfileInformation) {
    HRESULT hr = S_OK;

    CArray<ProfileInfo *, ProfileInfo *> aAllProfileInformation;
    hr = ReadProfiles(aAllProfileInformation);

    if (SUCCEEDED(hr)) {
        for (int i = 0; i < aAllProfileInformation.GetSize(); ++i) {
            // default profiles have IDs betweeen 0 and 3000
            if (aAllProfileInformation[i]->GetID() > 0 && 
                aAllProfileInformation[i]->GetID() < DEFAULT_PROFILE_MAX)
                delete aAllProfileInformation[i];
            else 
                aProfileInformation.Add(aAllProfileInformation[i]);
        }
        aAllProfileInformation.RemoveAll();
    }

    return hr;
}
Beispiel #10
0
void CFavoriteOrganizeDlg::OnDownBnClicked()
{
	CArray<int> selectedItems;
	POSITION pos = m_list.GetFirstSelectedItemPosition();
	int nItem;

	while (pos) {
		nItem = m_list.GetNextSelectedItem(pos);

		if (nItem < 0 || nItem >= m_list.GetItemCount() - 1) {
			return;
		}

		selectedItems.Add(nItem);
	}

	for (int i = selectedItems.GetSize() - 1; i >= 0; i--) {
		MoveItem(selectedItems[i], +1);
	}
}
Beispiel #11
0
CActuator::CActuator(pTagObjClass pClass_, pchar TagIn, pTaggedObject pAttach, TagObjAttachment eAttach) :
  FlwNode(pClass_, TagIn, pAttach, eAttach)
    //,  m_MXRH(this)
  {
  if (ActuatorIOAreaList.GetSize()==0)
    {
    ActuatorIOAreaList.SetSize(MaxIOListLen);
    IONames.SetSize(MaxIOListLen);
    int j=0;
    for (int i=0; i<MaxXMTs; i++)
      {
      IONames[j].Set("A%i.Rqd", i);
      ActuatorIOAreaList[j]=BaseActuatorIOArea;
      ActuatorIOAreaList[j].m_Id=CtrlIOId(j);
      ActuatorIOAreaList[j].SetIOName(IONames[j]());
      ActuatorIOAreaList[j].SetIODesc("");
      j++;
      //IONames[j].Set("T%i.Raw", i);
      //ActuatorIOAreaList[j]=BaseActuatorIOArea;
      //ActuatorIOAreaList[j].Id=j;
      //ActuatorIOAreaList[j].pName=IONames[j]();
      //j++;
      }
    ActuatorIOAreaList[j++]=BaseActuatorIOArea;
    }                           

  AttachClassInfo(nc_Control, &ActuatorIOAreaList[0], &NullFlwGroup);

  SetActiveOptions(true, true);

  bOn = 1;

  //bDoneExtRefs = 0;
  bAboutToStart = 0;
  //m_DataBlk.GetSize() = 0;
  //m_DataBlk = NULL;
  for (int i=0; i<3; i++)
    m_StateLine[i] = "";
  m_StateLine[0] = "OK";
  //SetCount(MaxXMTs);
  }
Beispiel #12
0
COLORREF CMainFrame::GetColorFromColorButton(int nButtonID)
{
	CArray<CMFCRibbonBaseElement*, CMFCRibbonBaseElement*> arButtons;

	m_wndRibbonBar.GetElementsByID(nButtonID, arButtons);

	if (arButtons.GetSize() == 0)
	{
		return(COLORREF) -1;
	}

	CMFCRibbonColorButton* pColorButton = (CMFCRibbonColorButton*)arButtons.GetAt(0);

	COLORREF clr = pColorButton->GetColor();
	if (clr == (COLORREF)-1)
	{
		clr = pColorButton->GetAutomaticColor();
	}

	return clr;
}
int FindBreakpoint(const CString& fileName, int lineNumber)
{
    int count = m_breakpointInfo.GetSize();
    for (int i = 0; i < count; ++i)
    {
        BreakpointInfo& info = m_breakpointInfo[i];
        if (info.m_fileName == fileName  &&  info.m_lineNumber == lineNumber)
            return i;
    }

    return -1;
}
Beispiel #14
0
void InformApp::SendAllFrames(Changed changed, int value)
{
  if (changed == Preferences)
  {
    SetFonts();
    ClearScaledImages();
    ReportHtml::SetIEPreferences(NULL);
  }

  CArray<CFrameWnd*> frames;
  GetWindowFrames(frames);

  for (int i = 0; i < frames.GetSize(); i++)
  {
    CFrameWnd* frame = frames[i];
    if (frame->IsKindOf(RUNTIME_CLASS(ProjectFrame)))
      ((ProjectFrame*)frame)->SendChanged(changed,value);
    else if (frame->IsKindOf(RUNTIME_CLASS(ExtensionFrame)))
      ((ExtensionFrame*)frame)->SendChanged(changed,value);
  }
}
Beispiel #15
0
BOOL InformApp::PreTranslateMessage(MSG* pMsg)
{
  if ((pMsg->hwnd == NULL) && DispatchThreadMessageEx(pMsg))
    return TRUE;

  CArray<CFrameWnd*> frames;
  GetWindowFrames(frames);

  CWnd* wnd = CWnd::FromHandle(pMsg->hwnd);
  for (int i = 0; i < frames.GetSize(); i++)
  {
    CFrameWnd* frame = frames[i];
    if (wnd->GetTopLevelParent() == frame)
      return CWnd::WalkPreTranslateTree(frame->GetSafeHwnd(),pMsg);
  }

  CWnd* mainWnd = AfxGetMainWnd();
  if (mainWnd != NULL)
    return mainWnd->PreTranslateMessage(pMsg);
  return FALSE;
}
Beispiel #16
0
void CSelectPassenger::OnSelectPassenger()
{
	int selCount = listboxPassenger.GetSelCount();
	CArray<PassengerInfo>& passlist = CConfig::GetConfig().GetPassenger();
	CArray<int> selectedIndex;
	selectedIndex.SetSize(selCount);
	listboxPassenger.GetSelItems(selCount, selectedIndex.GetData());

	for(int i = 0; i < passlist.GetCount(); i++)
	{
		for(int j = 0; j < selectedIndex.GetCount(); j++)
		{
			CString str;
			listboxPassenger.GetText(selectedIndex[j], str);
			if(passlist[i].name == str)
			{
				selectedpass.Add(passlist[i]);
			}
		}
	}
}
Beispiel #17
0
//在src【】中寻找其中的最大值和最小值,number为src中元素的个数。
//bhasinited表示maxi和mini是否已经初始化了
void CSomeFuncs::SearchMaxMin( CArray<double, double>& src, double& maxi, double& mini, bool bHasInited )
{
    int number = src.GetSize();
    double* ptSrc = new double[number];
    for( int i = 0; i < number; i++ )
        ptSrc[i] = src[i];

    SearchMaxMin( ptSrc, number, maxi, mini, bHasInited );

    delete []ptSrc;

}
Beispiel #18
0
//
// Function :
//     Hide all of child view, exclude the parameter specified.
//
void CChildView::HideAllChildViewExclude(const CWnd * pViewExclude)
{
	CArray <CWnd *> WndArray;
	INT_PTR ArraySize = 0;
	INT_PTR i = 0;

	// Add all of child view here
	WndArray.Add((CWnd *)this->m_pResultView);
	WndArray.Add((CWnd *)this->m_pSkuListView);

	ArraySize = WndArray.GetSize();

	for ( i = 0; i < ArraySize; i++ )
	{
		CWnd * pIterator = WndArray.GetAt(i);
		if (pIterator != pViewExclude)
		{
			pIterator->ShowWindow(SW_HIDE);
		}
	}
}
Beispiel #19
0
BOOL ObjectDescription::Add(CArray <CString,CString&> &aListName,CMapStringToPtr &aListFind, CString csName0)
{
	CString csNAME=mUpper(csName0);
	if(!csNAME.IsEmpty())
	if(!aListFind[csNAME])
	{
		aListName.Add(csName0);
		aListFind[csNAME]=(void*)1;
		return TRUE;
	}
	return FALSE;
}
Beispiel #20
0
void CChartDlg::UpdateChart()
{
	// Get the indexes of all the selected items.
	int nCount = m_Datasel.GetSelCount();
	if(nCount <= 0)
		return;
	UpdateData();
	m_Chart.ClearAll();
	m_Chart.SetAxis(m_dBase+5.0*m_dVary,m_dBase-5.0*m_dVary,m_dBase,m_dVary*4.0);
	CArray<int,int> aryListBoxSel;
	aryListBoxSel.SetSize(nCount);
	m_Datasel.GetSelItems(nCount, aryListBoxSel.GetData()); 
	int nTotal = nCount;
	CString sCurr;
	while(nCount > 0)
	{
		m_Datasel.GetText(nTotal-nCount--,sCurr);
		m_Chart.AddData(atof(sCurr));

	}
}
Beispiel #21
0
int CuStaticRuler::GetPointArray (CArray< CPoint,CPoint >& pointArray)
{
	CaHeaderMarker* pHeader = NULL;
	POSITION pos = m_listHeader.GetHeadPosition();
	while (pos != NULL)
	{
		pHeader = m_listHeader.GetNext (pos);
		CPoint p = pHeader->GetPoint();
		pointArray.Add (p);
	}
	return (m_nOffsetOrigin + m_nLeftMagin);
}
Beispiel #22
0
void SeriesListCtrl::OnDeleteSeries()
{
	POSITION pos=GetFirstSelectedItemPosition(); bool upd=false; void *x;
	if(pos)
	{
		CArray<int,const int&> ToDel; int i; CString temp; 
		while(pos) ToDel.Add(GetItemData(GetNextSelectedItem(pos)));
		qsort(ToDel.GetData(),ToDel.GetSize(),sizeof(int),compfunc);

		for(i=0;i<ToDel.GetSize();i++)
		{
			int n=ToDel[i];			
			temp.Format("Series %s contains %d points. Remove it?",Items[n].Name,Items[n].Size);
			if(AfxMessageBox(temp,MB_YESNO)==IDNO) ToDel[i]=-1;		
		}
		
		if((x=Series->GainAcsess(WRITE))!=0)
		{
			upd=true;
			SeriesProtector Protector(x); TSeriesArray& Series(Protector);
			{
				for(i=0;i<ToDel.GetSize();i++)
					if(ToDel[i]>=0) Series.DeleteItem(ToDel[i]);
			}
		}
		if(upd) UpdateSeriesList();
	}		
}
void CFileSelectList::Export(CArray<TRANSFER_ITEMSEL_STRUCT>& aryItem,CImageList& ImageList)
{
	//导出图标
	//while(ImageList.GetImageCount()>0)
	//	ImageList.Remove(0);
	//for(int i = 0;i < m_ImageListNormal.GetImageCount();++i)
	//{
	//	HICON hIcon = m_ImageListNormal.ExtractIcon(i);
	//	if(hIcon)
	//	{
	//		ImageList.Add(hIcon);
	//		DestroyIcon(hIcon);
	//	}

	//}
	aryItem.RemoveAll();
	int iCount = GetItemCount();
	for(int i = 0;i < iCount; ++i)
	{
		CString strPath;
		TCHAR tcBuf[MAX_PATH];


		LVITEM lvit = {0};
		lvit.iItem = i;
		lvit.iSubItem = 0;
		lvit.pszText = tcBuf;
		lvit.cchTextMax = sizeof(tcBuf);
		lvit.mask = LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM;
		GetItem(&lvit);

		TRANSFER_ITEMSEL_STRUCT tsi={0};
		tsi.strItemName = lvit.pszText;
		tsi.strItemPath = ((ItemDataType*)lvit.lParam)->strItemUrl;//GetItemText(i,1) + tsi.strItemName;
		tsi.iItemImg = lvit.iImage;

		aryItem.Add(tsi);
	}

}
Beispiel #24
0
BOOL CPropDlg::OnInitDialog() {
	CDialog::OnInitDialog();

	SetWindowText(L"Properties - " + m_titleDesc);

	// Full-row selection is more intuitive
	//
	m_propList.SetExtendedStyle(m_propList.GetExtendedStyle() | LVS_EX_FULLROWSELECT);

	// Set up the name/value colums for the property list.
	//
	m_propList.InsertColumn(0, L"Name", LVCFMT_LEFT, 128);
	m_propList.InsertColumn(1, L"Value", LVCFMT_LEFT, 384);

	CArray<DISPID> aDispIDs;
	CArray<CStringW> asNames, asValues;
	GetObjectProperties(m_object, aDispIDs, asNames, asValues);
	ASSERT(aDispIDs.GetSize() == asNames.GetSize());
	ASSERT(aDispIDs.GetSize() == asValues.GetSize());

	for (int iItemCnt = 0; iItemCnt < aDispIDs.GetSize(); iItemCnt++)
	{
		int listItem = m_propList.InsertItem(0, asNames[iItemCnt]);
		m_propList.SetItemData(listItem, (DWORD_PTR)aDispIDs[iItemCnt]);
		m_propList.SetItemText(listItem, 1, asValues[iItemCnt]);
	}
	if (m_propList.GetItemCount() > 0)
		m_propList.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);

	// Set up resizing
	//
	m_resizeHelper.Init(m_hWnd);
	m_resizeHelper.Fix(IDC_PROPLIST, DlgResizeHelper::kLeftRight, DlgResizeHelper::kTopBottom);
	m_resizeHelper.Fix(IDC_PROPERTIES_BUTTON, DlgResizeHelper::kWidthRight, DlgResizeHelper::kHeightTop);
	m_resizeHelper.Fix(IDOK, DlgResizeHelper::kWidthRight, DlgResizeHelper::kHeightTop);

	updateButtons();

	return TRUE;
}
Beispiel #25
0
void CDlgSpeedTest::Sort()
{
	CMap<DWORD,DWORD,SpeedTestResult,SpeedTestResult> mapTmp;
	CArray<SpeedTestResult,SpeedTestResult> ayTmp;
	for (int i=0; i<m_ayTestResult.GetCount(); i++)
	{
		SpeedTestResult res = m_ayTestResult.GetAt(i);
		if (!res.m_bError)
		{
			mapTmp.SetAt(res.m_result,res);
		}
		else
			ayTmp.Add(res);
	}
	m_ayTestResult.RemoveAll();
	POSITION pos = mapTmp.GetStartPosition();
	DWORD key;
	SpeedTestResult val;
	while (pos)
	{
		mapTmp.GetNextAssoc(pos,key,val);
		m_ayTestResult.Add(val);
	}
	for (int j=0; j<ayTmp.GetCount(); j++)
	{
		m_ayTestResult.Add(ayTmp.GetAt(j));
	}

	for(int i=0; i<m_cList.GetItemCount(); i++)
	{
		CString str;
		str = m_cList.GetItemText(i,0);
		if (FindRes(str))
		{
			m_cList.DeleteItem(i);
			i--;
		}
	}
	ShowRes();
}
bool tScriptState::Run()
{
    bool bResult = FALSE;
    f = fopen(name, "rt");
    if (f)
    {
        bool bSilent = TRUE;
        PreprocessScript(bSilent);
        fclose(f);
        if (!IsFailed())
        {
            currentCommandIndex = 0;
            bResult = TRUE;
            while (bResult)
            {
                tCommand *pCommand = NULL;
                if (currentCommandIndex < Commands.GetCount())
                    pCommand = Commands.GetAt(currentCommandIndex);
                if (pCommand)
                {
                    LogTestFlow("Executing %04d.%d(%04d) %s\n", pCommand->line, pCommand->lineDot, currentCommandIndex, (LPCSTR)pCommand->Description() );
                    currentCommandIndex++;
                    if (!ExecuteCommand(*pCommand))
                        break;
                    bResult = !IsFailed();
                }
                else
                {
                    break;
                }
            }
        }
    }
    else
    {
        callback(ref, escriptEvtPreprocessFail, "Can't open %s", name);
        bResult = FALSE;
    }
    return bResult;
}
void CInteractionAreaDialog::CreateTargetmarkPopup(int nAction, int nButtonId, int nEditId)
{
	CRect rcButton;
   CWnd *pWndButton = GetDlgItem(nButtonId);
   
   pWndButton->GetClientRect(rcButton);
   pWndButton->ClientToScreen(&rcButton);
   
   CMarkStream *pMarkStream = m_pEditorDoc->project.GetMarkStream();
   if (pMarkStream)
   {
      m_wndMenu.CreatePopupMenu();
      
      CArray<CStopJumpMark *, CStopJumpMark *> caJumpMarks;
      pMarkStream->GetJumpMarksInRegion(caJumpMarks, 0, m_pEditorDoc->m_docLengthMs);
      for (int i = 0; i < caJumpMarks.GetSize(); ++i)
      {
         CString csLabel;
         csLabel = caJumpMarks[i]->GetLabel();
         m_wndMenu.AppendMenu(MF_STRING, i+1, csLabel);
      }
      
      BOOL bRet = m_wndMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, rcButton.left, rcButton.bottom, this);
      
      CWnd *pEdit = GetDlgItem(nEditId);
      // if bRet is zero the menu was cancelled 
      // or an error occured
      if (bRet != 0)
      {
         CString csItem;
         m_wndMenu.GetMenuString(bRet, csItem, MF_BYCOMMAND);
         pEdit->SetWindowText(csItem);
         m_nMarkOrPageId[nAction] = caJumpMarks[bRet-1]->GetId();
      }
      
      caJumpMarks.RemoveAll();
      
      m_wndMenu.DestroyMenu();
   }
}
void CTrackContrl::AlterDivideLeft(const int nAlterDivideWid,int coor[],const int nSize)
{
	//先排序
	Msort(coor,coor,0,nSize-1);
	CArray<CControlRect*,CControlRect*> sortTracker;
	for(int i=0;i<nSize;i++)
	{
		for(int j=0;j<m_selectRectTracker.GetSize();j++)
		{
			if(coor[i] == m_selectRectTracker[j]->m_rect.left)
			{
				sortTracker.Add(m_selectRectTracker[j]);
				break;
			}
		}
	}

	//然后移动
	for(int i=1;i<sortTracker.GetSize();i++)
	{
		CRect rect;
		rect.left = sortTracker[i-1]->m_rect.right + nAlterDivideWid;
		rect.right = rect.left + sortTracker[i]->m_rect.Width();

		rect.top = sortTracker[i]->m_rect.top;
		rect.bottom = sortTracker[i]->m_rect.bottom;

		CRect oldRect;//获取没有移动前的rect
		sortTracker[i]->GetTrueRect(&oldRect);

		sortTracker[i]->m_rect = rect;//把新的位置付给控件
		sortTracker[i]->MoveWindow(&rect,FALSE);
		CRect newRect;//获取新的rect
		sortTracker[i]->GetTrueRect(&newRect);

		//重绘
		sortTracker[i]->GetParent()->InvalidateRect(oldRect,TRUE);
		sortTracker[i]->GetParent()->InvalidateRect(newRect,TRUE);
	}
}
    Tsint main(const CStringBuffer<CString>& a_crArguments, const CStringBuffer<CString>& a_crEnvironment)
    {   CALL
        IGNORE_UNUSED(a_crArguments);
        IGNORE_UNUSED(a_crEnvironment);

        // Use standard output stream of the current process.
        CStreamStdOutput stdoutput(true);

        CArray<Tbool> a;

        // Fill the array.
        a.insertFirst(false);
        a.insertFirst(true);
        a.insertLast(false);
        a.insertLast(true);
        a.insertIndex(2, true);

        // Show the array.
        stdoutput << a;

        // Copy the array.
        CArray<Tbool> b(a);

        // Reverse the array.
        b.reverse();

        // Show the reversed array.
        stdoutput << b;

        // Remove items from arrays.
        remove(stdoutput, a, true);
        remove(stdoutput, b, false);

        return IApplication::EXIT_WITH_SUCCESS;
    }
Beispiel #30
0
/////////////////////////////////////////////////////////////////////////////
//загрузка системной библиотеки объектов
void CMetadata::LoadSystemLibrary()
{
	CString StartPath=csCurrentExeDir;
	StartPath.TrimRight('\\');
	StartPath+="\\SYSTEM\\";
	
	
	SetCurrentDirectory(csIBDir);

	WIN32_FIND_DATA fdata;
	HANDLE hfind=FindFirstFile(StartPath+"*.md2",&fdata);
	if(NULL==hfind || INVALID_HANDLE_VALUE==hfind)
		return;

	CArray <CString,CString&> aLibName;
	do
	{
		CString csName=StartPath + fdata.cFileName;
		if(mUpper(csName)!=mUpper(m_csConfigPath))
			aLibName.Add(csName);
	}
	while(FindNextFile(hfind,&fdata));
	FindClose(hfind);


//	m_zip.Open(m_csConfigPath, CZipArchive::create,0);//Новый архив
//	m_zip.Close();	

	//сортировка
	SortList(aLibName);
	for(int i=0;i<aLibName.GetSize();i++)
	{
		CString csName=mUpper(aLibName[i]);
		if(csName.Right(4)==".MD2")
		//AfxMessageBox(aLibName[i]);
			AddLibrary(aLibName[i]);
	}

}