TRichEdit

TRichEdit

Postby ryugarai27 » Mon Dec 06, 2010 8:36 am

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!
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 92 guests