Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fread crash Pin
sfeldi19-Jul-05 20:38
sfeldi19-Jul-05 20:38 
QuestionTextOut being clipped in Windows 2000? Pin
MacWarrior19-Jul-05 3:10
MacWarrior19-Jul-05 3:10 
AnswerRe: TextOut being clipped in Windows 2000? Pin
David Crow19-Jul-05 3:21
David Crow19-Jul-05 3:21 
GeneralReading REG_SZ from Win registry Pin
rudoq3219-Jul-05 3:09
rudoq3219-Jul-05 3:09 
GeneralRe: Reading REG_SZ from Win registry Pin
David Crow19-Jul-05 3:19
David Crow19-Jul-05 3:19 
GeneralRe: Reading REG_SZ from Win registry Pin
Blake Miller19-Jul-05 5:50
Blake Miller19-Jul-05 5:50 
GeneralRe: Reading REG_SZ from Win registry Pin
John R. Shaw20-Jul-05 9:53
John R. Shaw20-Jul-05 9:53 
QuestionHow to handle IE (ATL/COM/MFC) Pin
19-Jul-05 3:03
suss19-Jul-05 3:03 
please help me..
I've develop something.
First I made a txt file that contains just some word "Hello, Bye, etc.." and then load it on the IE.
Second check the text on the IE, and then compare the text with some pattern like "Hello".
Third I add some html cord. The function of cord would change background color of the text "Hello" and hand cursor shape, if the pattern is same.

OK. Now I want to add some more function.
1. If I click the text that was already changed background color, and some more things,
('couse same with some pattern like "Hello")
then I want to make pop up my Dialog box(modal) on the IE. The box name is IDD_POPUP.
2. Next, the IDD_POPUP has a static text. I want to show the "Hello" on the static box of IDD_POPUP.


That's all.. plz help me~
------------------------------------------------------------------------------------------------
void CABC::RegexHighlight(CComPtr<ihtmldocument2> spHTML)
///reference - http://www.codeproject.com/miscctrl/chtmlview_search.asp
{
static IRegExpPtr regExp( __uuidof(RegExp) );
static IRegExpPtr regExp_1( __uuidof(RegExp) );

LPCTSTR lpszPattern = " Hello /*some pattern*/ ";
regExp->Pattern = lpszPattern;
regExp->put_Global(VARIANT_TRUE);

IMatchCollectionPtr matches;
IMatchPtr match, tempMatch;
long m_cnt;
int i;
long startPoint, strLength;

IHTMLElement *lpBodyElm;
IHTMLBodyElement *lpBody;
IHTMLTxtRange *lpTxtRange;
bool bFound;

spHTML->get_body(&lpBodyElm);
lpBodyElm->QueryInterface(IID_IHTMLBodyElement,(void**)&lpBody);
lpBody->createTextRange(&lpTxtRange);

CString cstr;
BSTR bstr, tmpbstr;
BSTR bmark;
VARIANT_BOOL ret;
lpTxtRange->get_text(&bstr);
lpTxtRange->getBookmark(&bmark);
cstr = bstr;

matches = regExp->Execute(bstr);
m_cnt = matches->Count;

CString chkStr[1000];
long c_cnt = 0;
bool isChk = false;

for (i = 0; i < m_cnt; i++) {
match = matches->Item[i];
startPoint = match->FirstIndex;
strLength = match->Length;

match->get_Value(&tmpbstr);
CString searchText = tmpbstr;

CComBSTR html;
CComBSTR newhtml;
CComBSTR search(searchText.GetLength()+1,(LPCTSTR)searchText);

while(lpTxtRange->findText(search,0,2,(VARIANT_BOOL*)&bFound),bFound) //lFlags = 2 or 0
{
newhtml.Empty();
lpTxtRange->get_htmlText(&html);

//change the background color, etc..

newhtml.Append(" <span id='regexnum' style='color: Black; background-color: yellow'><font style='cursor:hand'>");
newhtml.AppendBSTR(html);
newhtml.Append("dssd");


lpTxtRange->pasteHTML(newhtml);
}
lpTxtRange->moveToBookmark(bmark, &ret);
}

}

GeneralInsert image or icon Pin
Halawlaws19-Jul-05 2:49
Halawlaws19-Jul-05 2:49 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 2:55
David Crow19-Jul-05 2:55 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 3:22
Halawlaws19-Jul-05 3:22 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 3:27
David Crow19-Jul-05 3:27 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 3:28
Halawlaws19-Jul-05 3:28 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 5:30
David Crow19-Jul-05 5:30 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 5:32
Halawlaws19-Jul-05 5:32 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 5:38
David Crow19-Jul-05 5:38 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 5:40
Halawlaws19-Jul-05 5:40 
GeneralRe: Change position Pin
Halawlaws19-Jul-05 5:51
Halawlaws19-Jul-05 5:51 
GeneralRe: Change position Pin
David Crow19-Jul-05 5:58
David Crow19-Jul-05 5:58 
GeneralRe: Change position Pin
Halawlaws19-Jul-05 6:00
Halawlaws19-Jul-05 6:00 
GeneralRe: Change position Pin
David Crow19-Jul-05 6:13
David Crow19-Jul-05 6:13 
GeneralRe: Change position Pin
Halawlaws19-Jul-05 6:01
Halawlaws19-Jul-05 6:01 
GeneralRe: Change position Pin
David Crow19-Jul-05 6:15
David Crow19-Jul-05 6:15 
GeneralRe: Change position Pin
Halawlaws19-Jul-05 20:19
Halawlaws19-Jul-05 20:19 
GeneralRe: Change position Pin
David Crow20-Jul-05 3:26
David Crow20-Jul-05 3:26 

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.