EM_GETCHARFORMAT, SCF_SELECTION and CFM_UNDERLINETYPE question

  • Thread starter Thread starter Academia
  • Start date Start date
A

Academia

I use EM_GETCHARFORMAT, SCF_SELECTION and CFM_UNDERLINETYPE to get the
underline type.

And it works all the time except when there is no underlined text.

Then it returns: 1 (CFU_UNDERLINE). Which is the code for a single underline
line.

I'd expect: 0 (CFU_UNDERLINENONE)

The "1" return happens if I check immediately after loading the form and it
contains no text.

Or if I have text, some with underline and some without, and I check the
text without.

Or if I check text that is mixed underline and not underlined. (Since
SCF_SELECTION checks the first character in the selection this should not be
a problem).

It also returns that if the text type is a single underline (as it should).

If the type is something else, say thick, it returns what is expected.



Anyone have a clue as to what is going on?



Thanks
 
Academia said:
I use EM_GETCHARFORMAT, SCF_SELECTION and CFM_UNDERLINETYPE to get the
underline type.

And it works all the time except when there is no underlined text.

Then it returns: 1 (CFU_UNDERLINE). Which is the code for a single
underline line.

I'd expect: 0 (CFU_UNDERLINENONE)

I do not have an idea, but I suggest to post a code snippet to be able to
repro the problem.
 
Back
Top