Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Requestion(some changes ) Pin
MsmVc27-Aug-08 0:13
MsmVc27-Aug-08 0:13 
QuestionRe: Requestion(some changes ) Pin
David Crow27-Aug-08 3:28
David Crow27-Aug-08 3:28 
QuestionCreateProcess() method Pin
Madan Chauhan26-Aug-08 20:02
Madan Chauhan26-Aug-08 20:02 
AnswerRe: CreateProcess() method Pin
Nibu babu thomas26-Aug-08 20:08
Nibu babu thomas26-Aug-08 20:08 
AnswerRe: CreateProcess() method Pin
Jijo.Raj26-Aug-08 20:30
Jijo.Raj26-Aug-08 20:30 
Question[Message Deleted] Pin
ptr_Electron26-Aug-08 19:16
ptr_Electron26-Aug-08 19:16 
AnswerRe: Application crash before the window is displayed Pin
Nibu babu thomas26-Aug-08 19:36
Nibu babu thomas26-Aug-08 19:36 
QuestionRich Edit control Highlight selection color problem Pin
riteshsv26-Aug-08 19:13
riteshsv26-Aug-08 19:13 
Hello,

I am trying to change the Back Ground color of highlight when a text is selected in Rich edit control to Yellow color.

The problem is it does not leave the default Black color and mixes the Yellow with Black to generate a Highlight of Blue instead of yellow.

Mentioned below is the code:

void CEditSubClass::OnChange()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CEdit::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.

// TODO: Add your control notification handler code here
CString strText;
int nLengthofString , i;

this->GetWindowText(strText);
nLengthofString = this->GetWindowTextLength();

//get pointer to htmlsourcebar
CMainFrame* pWnd = (CMainFrame*)(AfxGetMainWnd());
ASSERT_VALID(pWnd);

CHtmlSourceView* pHtmlView = pWnd->GetHtmlSourceBar();
CString m_txtHtmlViewSourceUpper;

//populate the FINDTEXTEX structure

FINDTEXTEX ft;
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
ft.lpstrText = (LPSTR) LPCTSTR(strText);

//find text

i = pHtmlView->m_ctlHtmlViewSource.FindText(FR_DOWN,&ft);

COLORREF crBkYellow = RGB(255,255,0);

CHARFORMAT2 fmt;
::memset(&fmt,0,sizeof(fmt));
fmt.cbSize = sizeof(fmt);
fmt.dwMask = CFM_BACKCOLOR;
fmt.dwEffects = 0;
fmt.crBackColor = crBkYellow;

long lResult = ::SendMessage(pHtmlView->m_ctlHtmlViewSource.GetSafeHwnd(), EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION, (LPARAM)&fmt);


//set the selection

pHtmlView->m_ctlHtmlViewSource.SetSel(i,i+nLengthofString);

pHtmlView->m_ctlHtmlViewSource.HideSelection(FALSE,TRUE);

}

I would be thankful to some one who can help me out.

Ritesh

QuestionSTL map issue Pin
George_George26-Aug-08 17:31
George_George26-Aug-08 17:31 
AnswerRe: STL map issue Pin
Nibu babu thomas26-Aug-08 19:11
Nibu babu thomas26-Aug-08 19:11 
GeneralRe: STL map issue Pin
George_George26-Aug-08 19:41
George_George26-Aug-08 19:41 
GeneralRe: STL map issue Pin
Nibu babu thomas26-Aug-08 19:58
Nibu babu thomas26-Aug-08 19:58 
GeneralRe: STL map issue Pin
George_George26-Aug-08 23:26
George_George26-Aug-08 23:26 
GeneralRe: STL map issue Pin
Nibu babu thomas26-Aug-08 23:32
Nibu babu thomas26-Aug-08 23:32 
GeneralRe: STL map issue Pin
George_George26-Aug-08 23:34
George_George26-Aug-08 23:34 
GeneralRe: STL map issue Pin
Nibu babu thomas26-Aug-08 23:50
Nibu babu thomas26-Aug-08 23:50 
GeneralRe: STL map issue Pin
George_George27-Aug-08 1:58
George_George27-Aug-08 1:58 
QuestionRPC Client Pin
sunny_vc26-Aug-08 15:44
sunny_vc26-Aug-08 15:44 
AnswerRe: RPC Client Pin
Garth J Lancaster26-Aug-08 17:00
professionalGarth J Lancaster26-Aug-08 17:00 
GeneralRe: RPC Client Pin
sunny_vc27-Aug-08 21:25
sunny_vc27-Aug-08 21:25 
QuestionLimit for vector????? Pin
TooShy2Talk26-Aug-08 15:29
TooShy2Talk26-Aug-08 15:29 
AnswerRe: Limit for vector????? Pin
Nibu babu thomas26-Aug-08 19:06
Nibu babu thomas26-Aug-08 19:06 
QuestionCMFCRibbonButton / CMFCRibbonBaseElement Pin
bigcivilmelon26-Aug-08 13:11
bigcivilmelon26-Aug-08 13:11 
QuestionNeed help to pass float or Double argument with _begintherad() Pin
smdhd26-Aug-08 12:41
smdhd26-Aug-08 12:41 
AnswerRe: Need help to pass float or Double argument with _begintherad() Pin
Rick York26-Aug-08 13:11
mveRick York26-Aug-08 13:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.