BOOL COXCustomizeBackgroundPage::OnQueryNewPalette() { // TODO: Add your message handler code here and/or call default SendMessageToDescendants(WM_QUERYNEWPALETTE,NULL,NULL); return COXCustomizePage::OnQueryNewPalette(); }
void CFrameWnd::InitialUpdateFrame( CDocument *pDoc, BOOL bMakeVisible ) /**********************************************************************/ { UNUSED_ALWAYS( pDoc ); if( GetActiveView() == NULL ) { CView *pView = (CView *)GetDescendantWindow( AFX_IDW_PANE_FIRST ); if( pView != NULL ) { if( pView->IsKindOf( RUNTIME_CLASS( CView ) ) ) { SetActiveView( pView ); } else if( pView->IsKindOf( RUNTIME_CLASS( CSplitterWnd ) ) ) { pView = (CView *)pView->GetDescendantWindow( AFX_IDW_PANE_FIRST ); if( pView->IsKindOf( RUNTIME_CLASS( CView ) ) ) { SetActiveView( pView ); } } } } if( pDoc != NULL ) { pDoc->UpdateFrameCounts(); } OnUpdateFrameTitle( TRUE ); SendMessageToDescendants( WM_INITIALUPDATE ); if( bMakeVisible ) { CWinApp *pApp = AfxGetApp(); ASSERT( pApp != NULL ); if( pApp->m_pMainWnd == this ) { ActivateFrame( pApp->m_nCmdShow ); pApp->m_nCmdShow = -1; } else { ActivateFrame(); } } }
void COXCustomizeBackgroundPage::OnPaletteChanged(CWnd* pFocusWnd) { COXCustomizePage::OnPaletteChanged(pFocusWnd); // TODO: Add your message handler code here SendMessageToDescendants(WM_PALETTECHANGED,(WPARAM)((HWND)*pFocusWnd),NULL); }
LRESULT CModuleSettings::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { std::wstring strWName; WinUTF8::UTF8string_to_wstring(m_strModuleName, strWName); SetWindowText(strWName.c_str()); int iDlgWidth = 7 + CModuleControl::CAPTION_WIDTH + CModuleControl::CHILD_WIDTH + 7; int iTop = 7; for (int i(0); i < m_iCount; ++i) { RECT controlRect = { 7, iTop, iDlgWidth - 7, iTop + m_pControls[i]->GetHeight() }; MapDialogRect(&controlRect); m_pControls[i]->Create(m_hWnd, controlRect); m_pControls[i]->Initialise(m_pAppSets); iTop += m_pControls[i]->GetHeight() + 2; } iTop += -2 + 7; MoveButton(IDCANCEL, iDlgWidth - 57, iTop); MoveButton(IDOK, iDlgWidth - 2 * (57), iTop); RECT size = { 0, 0, iDlgWidth, iTop + 14 + 7 }; MapDialogRect(&size); ResizeClient(size.right, size.bottom); SendMessageToDescendants(WM_SETFONT, (WPARAM)GetFont(), true); return 1; }
LRESULT CMainFrame::OnThreadStatus( WPARAM wParam, LPARAM lParam ) { switch( wParam ) { case THREAD_STATUS_CREATE_ERROR: SendMessageToDescendants( WM_APP_END_CREATE_FUZZ, NULL, NULL ); break; case THREAD_STATUS_MAKEFOLDER_ERROR: SendMessageToDescendants( WM_APP_END_CREATE_FUZZ, NULL, lParam ); break; case THREAD_STATUS_END: SendMessageToDescendants( WM_APP_END_CREATE_FUZZ, NULL, lParam ); break; } return TRUE; }
BOOL CGuiFrameWnd::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext) { // only do this once ASSERT_VALID_IDR(nIDResource); ASSERT(m_nIDHelp == 0 || m_nIDHelp == nIDResource); m_nIDHelp = nIDResource; // ID for help context (+HID_BASE_RESOURCE) CString strFullString; if (strFullString.LoadString(nIDResource)) AfxExtractSubString(m_strTitle, strFullString, 0); // first sub-string VERIFY(AfxDeferRegisterClass(AFX_WNDFRAMEORVIEW_REG)); // attempt to create the window LPCTSTR lpszClass = GetIconWndClass(dwDefaultStyle, nIDResource); LPCTSTR lpszTitle = m_strTitle; if (!Create(lpszClass, lpszTitle, dwDefaultStyle, rectDefault,pParentWnd, NULL, 0L, pContext)) { return FALSE; // will self destruct on failure normally } // save the default menu handle ASSERT(m_hWnd != NULL); m_hMenuDefault = ::GetMenu(m_hWnd); // load accelerator resource LoadAccelTable(MAKEINTRESOURCE(nIDResource)); if (pContext == NULL) // send initial update SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE); return TRUE; }
BOOL CTaikaDlg::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN) // Estetään RETURNIN painaminen dialogissa (dialogi ei sulkeudu vahingossa) { if(pMsg->wParam == VK_RETURN) return TRUE; } SendMessageToDescendants(WM_KICKIDLE, 0, 0, FALSE, FALSE); return CDialog::PreTranslateMessage(pMsg); }
void CMainFrame::WinHelp(DWORD dwData, UINT nCmd) { if (RDialog::m_pHintBox) RDialog::m_pHintBox->ShowWindow(false); CWinApp* pApp = AfxGetApp(); ASSERT_VALID(pApp); ASSERT(pApp->m_pszHelpFilePath != NULL); CWaitCursor wait; if (IsFrameWnd()) { // CFrameWnd windows should be allowed to exit help mode first CFrameWnd* pFrameWnd = (CFrameWnd*)this; pFrameWnd->ExitHelpMode(); } // cancel any tracking modes SendMessage(WM_CANCELMODE); SendMessageToDescendants(WM_CANCELMODE, 0, 0, TRUE, TRUE); // need to use top level parent (for the case where m_hWnd is in DLL) CWnd* pWnd = GetTopLevelParent(); pWnd->SendMessage(WM_CANCELMODE); pWnd->SendMessageToDescendants(WM_CANCELMODE, 0, 0, TRUE, TRUE); // attempt to cancel capture HWND hWndCapture = ::GetCapture(); if (hWndCapture != NULL) ::SendMessage(hWndCapture, WM_CANCELMODE, 0, 0); TRACE3("WinHelp: pszHelpFile = '%s', dwData: $%lx, fuCommand: %d.\n", pApp->m_pszHelpFilePath, dwData, nCmd); /*x0r disable help //Command equates are different between WinHelp and HTMLHelp. Why? switch (nCmd) { case HELP_CONTEXT: //DeadCode RJS 03May100 nCmd=HH_DISPLAY_TOPIC; nCmd=HH_HELP_CONTEXT; break; } // finally, run the Windows Help engine //DeadCode RJS 03May100 if (!HtmlHelp(pWnd->m_hWnd, CString(pApp->m_pszHelpFilePath)+"::/asset.htm", nCmd, 0)) //DEADCODE DAW 15/05/00 if (!HtmlHelp(NULL, pApp->m_pszHelpFilePath, nCmd, dwData&0xffff)) if (!HtmlHelp(pWnd->m_hWnd, pApp->m_pszHelpFilePath, nCmd, dwData&0xffff)) { dwData=IDD_RAFCOMMANDBRIEFING; if (!HtmlHelp(pWnd->m_hWnd, pApp->m_pszHelpFilePath, nCmd, dwData&0xffff)) AfxMessageBox(AFX_IDP_FAILED_TO_LAUNCH_HELP); } */ }
void CMainFrame::OnPaletteChanged(CWnd* pFocusWnd) { CMDIFrameWnd::OnPaletteChanged(pFocusWnd); // always realize the palette for the active view CMDIChildWnd* pMDIChildWnd = MDIGetActive(); if (pMDIChildWnd == NULL) return; // no active MDI child frame CView* pView = pMDIChildWnd->GetActiveView(); ASSERT(pView != NULL); // notify all child windows that the palette has changed SendMessageToDescendants(WM_DOREALIZE, (WPARAM)pView->m_hWnd); }
LRESULT CMainFrame::OnThreadCtrl( WPARAM wParam, LPARAM lParam ) { switch( wParam ) { case THREAD_CTRL_START: SendMessageToDescendants( WM_APP_START_CREATE_FUZZ, NULL, NULL ); m_FuzzCreateThread.CreateThread( this->m_hWnd, (HWND)lParam, &m_FixedDatas, ((CIFuzzMakerDoc*)GetActiveDocument())->GetUserDatas() ); break; case THREAD_CTRL_CANCEL: m_FuzzCreateThread.Cancel(); break; } return TRUE; }
LRESULT CMainFrame::OnReadJpeg( WPARAM wParam, LPARAM lParam ) { int nSegmentCount = 0; CSegmentData *lpSegmentData = NULL; CSegmentInfo *lpSegmentInfo = NULL; CFileReader FileReader; CJpegAnalyzer JpegAnalyzer; CUserDatas* lpUserDatas = ((CIFuzzMakerDoc*)GetActiveDocument())->GetUserDatas(); lpUserDatas->GetReadBufferArray().RemoveAll(); if( !FileReader.ReadFile( lpUserDatas->GetJpegFileName(), lpUserDatas->GetReadBufferArray() ) ) { // エラー return FALSE; } // Jpeg解析 lpUserDatas->GetSegmentDataArray().RemoveAllWithDelete(); if( !JpegAnalyzer.Analyze( lpUserDatas->GetReadBufferArray(), m_FixedDatas.GetSegmentInfoMap(), lpUserDatas->GetSegmentDataArray() ) ) return FALSE; // Exif解析 for(nSegmentCount=0; nSegmentCount<lpUserDatas->GetSegmentDataArray().GetSize(); nSegmentCount++ ) { lpSegmentData = lpUserDatas->GetSegmentDataArray().GetAt( nSegmentCount ); if( lpSegmentData ) { lpSegmentInfo = lpSegmentData->GetSegmentInfo(); if( lpSegmentInfo ) { if( lpSegmentInfo->GetMarker() == _T("FFE1") ) { CExifAnalyzer ExifAnalyzer; ExifAnalyzer.Analyze( lpUserDatas->GetReadBufferArray().GetSize(), lpSegmentData, &m_FixedDatas.GetImageFileDirectoryInfoMap(), &m_FixedDatas.GetTagTypeInfoMap() ); } if( lpSegmentInfo->IsAnalysisSegment() ) { CSegmentAnalyzer SegmentAnalyzer; SegmentAnalyzer.Analyze( lpUserDatas->GetReadBufferArray().GetSize(), lpSegmentData ); } } } } SendMessageToDescendants( WM_APP_EXIF_ANALYZED, NULL, NULL ); return TRUE; }
LRESULT CRunTestsSheet::OnKickIdle(WPARAM, LPARAM) { // We could use WM_KICKIDLE to drive CMDUI messages, but in fact we just // use an OnKickIdle handler directly (here and in the pages) to control // button greying. bool bEnableRunStop=false; bool bEnableProperties=false; switch(m_Status){ case Running: bEnableRunStop=true; break; case Stopping: bEnableProperties=true; break; case Stopped: bEnableRunStop=executionpage.SomeTestsSelected(); bEnableProperties=true; break; } GetDlgItem(IDOK)->EnableWindow(bEnableRunStop); GetDlgItem(ID_APPLY_NOW)->EnableWindow(bEnableProperties); SendMessageToDescendants(WM_KICKIDLE, 0, 0, FALSE, FALSE); return 0; }
BOOL COXCustomizeManager::ActivatePage(HSHBGROUP hGroup, int nIndex) { ASSERT(hGroup!=NULL && nIndex!=-1); COXCustomizePage* pCustomizePage=GetPageByLocation(hGroup,nIndex); if(pCustomizePage==NULL) { TRACE(_T("COXCustomizeManager::ActivatePage: failed to retrieve page object\n")); return FALSE; } COXCustomizePage* pActivePage=GetActivePage(); if(pCustomizePage==pActivePage) { return TRUE; } if(pActivePage!=NULL) { HSHBGROUP hGroupTest=NULL; int nIndexTest=-1; VERIFY(FindPage(pActivePage,hGroupTest,nIndexTest)); ASSERT(hGroupTest!=NULL && nIndexTest!=-1); if(hGroupTest!=hGroup) { COXSHBListCtrl* pListCtrl=m_shb.GetGroupListCtrl(hGroupTest); ASSERT(pListCtrl!=NULL); pListCtrl->ActivateItem(-1); } pActivePage->Unload(); m_pActivePage=NULL; } if(!pCustomizePage->Load(this)) { TRACE(_T("COXCustomizeManager::ActivatePage: failed to load the page\n")); return FALSE; } pCustomizePage->MoveWindow(GetPageRect()); pCustomizePage->SetFocus(); m_pActivePage=pCustomizePage; // expand corresponding group m_shb.ExpandGroup(hGroup); // activate corresponding item in the shortcut bar control COXSHBListCtrl* pListCtrl=m_shb.GetGroupListCtrl(hGroup); ASSERT(pListCtrl!=NULL); pListCtrl->ActivateItem(nIndex); pListCtrl->EnsureVisible(nIndex,FALSE); // change the title text m_title.SetWindowText(pListCtrl->GetItemText(nIndex,0)); // update the state of the "Apply Changes" button GetDlgItem(IDC_OX_BUTTON_APPLY)-> EnableWindow(pCustomizePage->IsSupportingApplyChanges()); // send initial update to all controls in the activated page SendMessageToDescendants(WM_INITIALUPDATE,0,0,TRUE,TRUE); return (pListCtrl->GetActiveItem()==nIndex); }
BOOL CPrintFrame::ContinueModal() { SendMessageToDescendants(WM_IDLEUPDATECMDUI, (WPARAM)TRUE, 0, TRUE, TRUE); return CWnd::ContinueModal(); }
LRESULT CMainFrame::OnCreateFuzzList( WPARAM wParam, LPARAM lParam ) { CUserDatas* lpUserDatas = ((CIFuzzMakerDoc*)GetActiveDocument())->GetUserDatas(); CFealdEntryDataArray CheckedFealdEntryDataArray; CSegmentItemDataArray CheckedSegmentItemDataArray; CPatternDataArray CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_COUNT]; CheckedFealdEntryDataArray.SetAutoDelete( FALSE ); CheckedSegmentItemDataArray.SetAutoDelete( FALSE ); CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FIELDENTRY].SetAutoDelete( FALSE ); CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_SEGMENT].SetAutoDelete( FALSE ); CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FILE].SetAutoDelete( FALSE ); lpUserDatas->GetFuzzDataArray().RemoveAllWithDelete(); for( int nSegmentData=0; nSegmentData<lpUserDatas->GetSegmentDataArray().GetSize(); nSegmentData++ ) { CSegmentData* lpSegmentData = lpUserDatas->GetSegmentDataArray().GetAt(nSegmentData); // 選択されているタグ取得 for( int nExifData=0; nExifData<lpSegmentData->GetExifDataArray()->GetSize(); nExifData++ ) { CExifData* lpExifData = lpSegmentData->GetExifDataArray()->GetAt(nExifData); for( int nImageFileDirectoryData=0; nImageFileDirectoryData<lpExifData->GetImageFileDirectoryDataArray()->GetSize(); nImageFileDirectoryData++ ) { //bListGroup = FALSE; CImageFileDirectoryData* lpImageFileDirectoryData = lpExifData->GetImageFileDirectoryDataArray()->GetAt(nImageFileDirectoryData); for( int nFealdEntryData=0; nFealdEntryData<lpImageFileDirectoryData->GetFealdEntryDataArray()->GetSize(); nFealdEntryData++ ) { CFealdEntryData* lpFealdEntryData = lpImageFileDirectoryData->GetFealdEntryDataArray()->GetAt(nFealdEntryData); { if( lpFealdEntryData->GetCheck() ) { CheckedFealdEntryDataArray.Add( lpFealdEntryData ); } } } } } // 選択されているセグメントパターンを取得 if( lpSegmentData->GetSegmentInfo() && lpSegmentData->GetSegmentInfo()->IsAnalysisSegment() ) { for( int nSegmentItemData=0; nSegmentItemData<lpSegmentData->GetSegmentItemDataArray()->GetSize(); nSegmentItemData++ ) { CSegmentItemData *lpSegmentItemData = lpSegmentData->GetSegmentItemDataArray()->GetAt( nSegmentItemData ); if( lpSegmentItemData->GetCheck() ) { CheckedSegmentItemDataArray.Add( lpSegmentItemData ); } } } } // 選択されているパターンを取得 for( int nPatternGroupData=0; nPatternGroupData<lpUserDatas->GetPatternGroupDataArray().GetSize(); nPatternGroupData++ ) { CPatternGroupData* lpPatternGroupData = lpUserDatas->GetPatternGroupDataArray().GetAt( nPatternGroupData ); for( int nPatternData=0; nPatternData<lpPatternGroupData->GetPatternDataArray()->GetSize(); nPatternData++ ) { CPatternData* lpPatternData = lpPatternGroupData->GetPatternDataArray()->GetAt(nPatternData); if( lpPatternData->GetCheck() ) { if( lpPatternData->GetFuzzArea() == CPatternData::FUZZAREA_SEGMENT ) CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_SEGMENT].Add( lpPatternData ); else if( lpPatternData->GetFuzzArea() == CPatternData::FUZZAREA_FILE ) CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FILE].Add( lpPatternData ); else CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FIELDENTRY].Add( lpPatternData ); } } } for( int nFealdEntryData=0; nFealdEntryData<CheckedFealdEntryDataArray.GetSize(); nFealdEntryData++ ) { CFealdEntryData* lpFealdEntryData = CheckedFealdEntryDataArray.GetAt( nFealdEntryData ); for( int nPatternData=0; nPatternData<CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FIELDENTRY].GetSize(); nPatternData++ ) { CPatternData* lpPatternData = CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FIELDENTRY].GetAt( nPatternData ); // タグ指定あり if( lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_TAG ) { if( lpPatternData->GetFieldKey() != lpFealdEntryData->GetTagID() ) { continue; } } // タイプ指定あり if( lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_TYPE ) { if( _tstol(lpPatternData->GetFieldKey()) != lpFealdEntryData->GetType() ) { continue; } } CFuzzData* lpFuzzData = NULL; lpUserDatas->GetFuzzDataArray().AddWithNew( lpFuzzData ); lpFuzzData->SetFuzzDataType( CFuzzData::FUZZDATA_TYPE_FIELDENTRY ); lpFuzzData->SetFealdEntryData( lpFealdEntryData ); lpFuzzData->SetPatternData( lpPatternData ); } } for( int nSegmentItemData=0; nSegmentItemData<CheckedSegmentItemDataArray.GetSize(); nSegmentItemData++ ) { CSegmentItemData *lpSegmentItemData = CheckedSegmentItemDataArray.GetAt( nSegmentItemData ); for( int nPatternData=0; nPatternData<CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_SEGMENT].GetSize(); nPatternData++ ) { CPatternData* lpPatternData = CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_SEGMENT].GetAt( nPatternData ); // 指定あり if( lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_SEGMENT ) { if( lpPatternData->GetFieldKey() != lpSegmentItemData->GetSegmentItemInfo()->GetItemTag() ) { continue; } } CFuzzData* lpFuzzData = NULL; lpUserDatas->GetFuzzDataArray().AddWithNew( lpFuzzData ); lpFuzzData->SetFuzzDataType( CFuzzData::FUZZDATA_TYPE_SEGMENT ); lpFuzzData->SetSegmentItemData( lpSegmentItemData ); lpFuzzData->SetPatternData( lpPatternData ); } } for( int nPatternData=0; nPatternData<CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FILE].GetSize(); nPatternData++ ) { CPatternData* lpPatternData = CheckedPatternDataArray[CFuzzData::FUZZDATA_TYPE_FILE].GetAt( nPatternData ); CFuzzData* lpFuzzData = NULL; lpUserDatas->GetFuzzDataArray().AddWithNew( lpFuzzData ); lpFuzzData->SetFuzzDataType( CFuzzData::FUZZDATA_TYPE_FILE ); lpFuzzData->SetPatternData( lpPatternData ); } SendMessageToDescendants( WM_APP_FUZZ_LIST_DISP, NULL, NULL ); return TRUE; }
LRESULT CMainFrame::OnReadGroup( WPARAM wParam, LPARAM lParam ) { int nGroupCount = 0; CUserDatas* lpUserDatas = ((CIFuzzMakerDoc*)GetActiveDocument())->GetUserDatas(); lpUserDatas->GetPatternGroupDataArray().RemoveAllWithDelete(); CPatternGroupInfoLoader PatternGroupInfoLoader; CPatternGroupInfoArray PatternGroupInfoArray; if( !PatternGroupInfoLoader.LoadText( lpUserDatas->GetGroupFileName(), &PatternGroupInfoArray ) ) return FALSE; for( nGroupCount=0; nGroupCount<PatternGroupInfoArray.GetSize(); nGroupCount++ ) { CPatternGroupInfo *lpPatternGroupInfo = PatternGroupInfoArray.GetAt( nGroupCount ); CPatternInfoLoader PatternInfoLoader; if( !PatternInfoLoader.LoadText( lpPatternGroupInfo->GetFileName(), lpPatternGroupInfo->GetPatternInfoArray() ) ) { } } for( nGroupCount=0; nGroupCount<PatternGroupInfoArray.GetSize(); nGroupCount++ ) { CPatternGroupInfo *lpPatternGroupInfo = PatternGroupInfoArray.GetAt( nGroupCount ); if( lpPatternGroupInfo->GetDispFlag() ) { CPatternGroupData* lpPatternGroupData = NULL; lpUserDatas->GetPatternGroupDataArray().AddWithNew( lpPatternGroupData ); lpPatternGroupData->SetDispName( lpPatternGroupInfo->GetDispName() ); for(int nPatternInfoCnt=0; nPatternInfoCnt<lpPatternGroupInfo->GetPatternInfoArray()->GetSize(); nPatternInfoCnt++ ) { CPatternInfo* lpPatternInfo = lpPatternGroupInfo->GetPatternInfoArray()->GetAt(nPatternInfoCnt); CPatternData* lpPatternData = NULL; CReadBufferArray BinaryDataArray; CStringA szValue = CT2A(lpPatternInfo->GetValue()); BYTE nDecValueByte = 0; unsigned short nDecValueShort = 0; unsigned int nDecValueInteger = 0; unsigned char* lpBuffer = NULL; if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_TEXT ) { // BinaryDataArray.SetSize( szValue.GetLength() * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) ); lpBuffer = BinaryDataArray.GetData(); for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ ) { CopyMemory( &lpBuffer[nRepeat*szValue.GetLength()], szValue.GetBuffer(), szValue.GetLength() ); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_8 ) { nDecValueByte = (BYTE)strtoul( szValue, NULL, 10 ); BinaryDataArray.SetSize( sizeof(nDecValueByte) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) ); lpBuffer = BinaryDataArray.GetData(); for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ ) { CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueByte)], &nDecValueByte, sizeof(nDecValueByte) ); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_16_LITTLE ) { nDecValueShort = (unsigned short)strtoul( szValue, NULL, 10 ); nDecValueShort = CEndianConverter::ConvertToShort( (unsigned char*)&nDecValueShort, FALSE ); BinaryDataArray.SetSize( sizeof(nDecValueShort) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) ); lpBuffer = BinaryDataArray.GetData(); for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ ) { CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueShort)], &nDecValueShort, sizeof(nDecValueShort) ); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_16_BIG ) { nDecValueShort = (unsigned short)strtoul( szValue, NULL, 10 ); nDecValueShort = CEndianConverter::ConvertToShort( (unsigned char*)&nDecValueShort, TRUE ); BinaryDataArray.SetSize( sizeof(nDecValueShort) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) ); lpBuffer = BinaryDataArray.GetData(); for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ ) { CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueShort)], &nDecValueShort, sizeof(nDecValueShort) ); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_32_LITTLE ) { nDecValueInteger = (unsigned int)strtoul( szValue, NULL, 10 ); nDecValueInteger = CEndianConverter::ConvertToInteger( (unsigned char*)&nDecValueInteger, FALSE ); BinaryDataArray.SetSize( sizeof(nDecValueInteger) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) ); lpBuffer = BinaryDataArray.GetData(); for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ ) { CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueInteger)], &nDecValueInteger, sizeof(nDecValueInteger) ); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_32_BIG ) { nDecValueInteger = (unsigned int)strtoul( szValue, NULL, 10 ); nDecValueInteger = CEndianConverter::ConvertToInteger( (unsigned char*)&nDecValueInteger, TRUE ); BinaryDataArray.SetSize( sizeof(nDecValueInteger) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) ); lpBuffer = BinaryDataArray.GetData(); for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ ) { CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueInteger)], &nDecValueInteger, sizeof(nDecValueInteger) ); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_HEX ) { // BinaryDataArray.SetSize( (int)(szValue.GetLength()/2) ); for( int cCnt=0; cCnt<(int)(szValue.GetLength()/2); cCnt++ ) { unsigned int nVal = strtol( szValue.Mid( cCnt*2, 2 ),NULL,16 ); BinaryDataArray.SetAt(cCnt, nVal); } }else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_BIN ) { // CFileReader fl; if( !fl.ReadFile( lpPatternInfo->GetFileName(), BinaryDataArray ) ) continue; } lpPatternGroupData->GetPatternDataArray()->AddWithNew( lpPatternData ); lpPatternData->SetCheck( lpPatternInfo->GetSelectFlag() ); lpPatternData->SetDispName( lpPatternInfo->GetDispName() ); lpPatternData->SetDataType( lpPatternInfo->GetDataType() ); lpPatternData->SetValue( lpPatternInfo->GetValue() ); lpPatternData->SetRepeat( lpPatternInfo->GetRepeat() ); lpPatternData->SetWriteMode( lpPatternInfo->GetWriteMode() ); lpPatternData->SetFuzzArea( lpPatternInfo->GetFuzzArea() ); lpPatternData->SetSearchField( lpPatternInfo->GetSearchField() ); lpPatternData->SetFieldKey( lpPatternInfo->GetFieldKey() ); lpPatternData->SetDescription( lpPatternInfo->GetDescription() ); lpPatternData->SetBinaryDataArray( BinaryDataArray ); if( lpPatternInfo->GetFuzzArea() == CPatternData::FUZZAREA_FILE ) { TCHAR* endptr = NULL; int nFilePos = _tcstol( lpPatternInfo->GetFieldKey(), &endptr, 10 ); if( _tcslen(endptr) ) continue; lpPatternData->SetFilePos( nFilePos ); } if( lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_TAG || lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_TYPE || lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_SEGMENT ) { POSITION pos = NULL; CString szKey; CImageFileDirectoryInfo *lpImageFileDirectoryInfo = NULL; CFealdEntryInfo* lpFealdEntryInfo = NULL; CSegmentItemInfo* lpSegmentItemInfo = NULL; CTagTypeInfo* lpTagTypeInfo = NULL; int nFieldKey = 0; switch(lpPatternData->GetSearchField()) { case CPatternData::SEARCHFIELD_TAG: pos = m_FixedDatas.GetImageFileDirectoryInfoMap().GetStartPosition(); while(pos) { m_FixedDatas.GetImageFileDirectoryInfoMap().GetNextAssoc( pos, szKey, lpImageFileDirectoryInfo ); if( lpImageFileDirectoryInfo->GetFealdEntryInfoMap()->Lookup( lpPatternData->GetFieldKey(), lpFealdEntryInfo ) ) break; } break; case CPatternData::SEARCHFIELD_TYPE: nFieldKey = _tstol(lpPatternData->GetFieldKey()); m_FixedDatas.GetTagTypeInfoMap().Lookup( nFieldKey, lpTagTypeInfo ); break; case CPatternData::SEARCHFIELD_SEGMENT: m_FixedDatas.GetSegmentItemInfoMap().Lookup( lpPatternData->GetFieldKey(), lpSegmentItemInfo ); break; } lpPatternData->SetFealdEntryInfo( lpFealdEntryInfo ); lpPatternData->SetTagTypeInfo( lpTagTypeInfo ); lpPatternData->SetSegmentItemInfo( lpSegmentItemInfo ); } } } } SendMessageToDescendants( WM_APP_GROUP_DISP, NULL, NULL ); return TRUE; }