Hi Fivewin Experts,
The following code returns the font effect status of selected text in richedit control:
#pragma BEGINDUMP
#include <Windows.h>
#include <HbApi.h>
#include <Richedit.h>
HB_FUNC ( REGETCHARFORMAT2)
{
CHARFORMAT2 cf;
cf.cbSize = sizeof (cf);
cf.dwMask = CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_SMALLCAPS | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_SIZE | CFM_FACE | CFM_CHARSET;
cf.dwEffects = CFE_SUBSCRIPT | CFE_SUPERSCRIPT | CFE_SMALLCAPS | CFE_BOLD | CFE_ITALIC | CFE_UNDERLINE;
SendMessage( ( HWND ) hb_parnl( 1 ), EM_GETCHARFORMAT, SCF_SELECTION, ( LPARAM ) &cf );
hb_reta ();
hb_storni (cf.dwEffects & CFE_SUBSCRIPT, -1, 1);
hb_storni (cf.dwEffects & CFE_SUPERSCRIPT, -1, 2);
hb_storni (cf.dwEffects & CFE_SMALLCAPS, -1, 3);
hb_storni (cf.dwEffects & CFE_BOLD, -1, 4);
hb_storni (cf.dwEffects & CFE_ITALIC, -1, 5);
hb_storni (cf.dwEffects & CFE_UNDERLINE, -1, 6);
}
The CHARFORMAT2 structure of RichEdit control contains a member bCharSet which contains the LOGFONT structure.
What I need to retieve is the lfCharSet member of the LOGFONT structure which can be accessed thru bCharset member of CHARFORMAT2 structure.
Any advice?
Thanks!