Hello Radu, thank's for your time and your great help. Finally I can understand how does it works.
jbosch(vosk)
Main Topics
Browse All TopicsHello, I have problems working with EM_GETCHARFORMAT and EM_GETPARAFORMAT messages: seems like they don't do anything. I use a richedit which I modify with EM_SETCHARFORMAT and EM_SETPARAFORMAT, since here that's all right. But when I try to retrieve the formats for each character the masks and formats seems empty (or does not match with any of the the previously setted formats and does not match with any valid value for those formats). That's what I use to get the formats:
CHARRANGE chr;
PARAFORMAT pf;
CHARFORMAT cf;
int l=GetWindowTextLength(hEdi
chr.cpMin=0;
chr.cpMax=1;
SetFocus(hEditor);
SendMessage(hEditor,EM_EXS
SendMessage(hEditor,EM_GET
SendMessage(hEditor,EM_GET
That should be right to retrieve the paraformat and charformat of the first character no? But using this the mask value (dwMask) returned in the PARAFORMAT and CHARFORMAT structs are both the same (2010562660), even if I set up a PFM_ALIGNMENT on the paraformat and whatever charformatting style, the mask returned is the same. Also if the text isn't formatted the mask returned is exactly the same as before. I have tried it selecting the hole text using the text length or selecting from cpMin=0to cpMax=-1 (selects also all the text), but the same result.
Then , how can I get those paraformat and charformats?
Thank's in advance
jbosch(vosk)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: rcarlanPosted on 2005-06-28 at 02:14:47ID: 14316194
Try this:
PARAFORMAT ,0,(LPARAM )&pf);
ZeroMemory(&pf, sizeof(pf));
pf.size = sizeof(pf);
pf.mask = PFM_ALIGNMENT | PFM_NUMBERING | PFM_OFFSET | PFM_OFFSETINDENT | PFM_RIGHTINDENT | PFM_STARTINDENT | PFM_TABSTOPS;
SendMessage(hEditor,EM_GET
ZeroMemory(&cf, sizeof(cf));
cf.size = sizeof(cf);
cf.mask = CFM_BOLD | CFM_CHARSET | CFM_COLOR | CFM_FACE | CFM_ITALIC | CFM_OFFSET | CFM_PROTECTED | CFM_SIZE | CFM_STRIKEOUT | CFM_UNDERLINE;
SendMessage(hEditor, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
Radu