Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Edit 2.0 Control

Status
Not open for further replies.

Skute

Programmer
Jul 21, 2003
272
GB
Has anyone used this control before?

Ive got one loaded on a dialog (non MFC) and im trying to change the colour and font as a test. Here is the code, it returns successfully, but doesnt appear to change anything:


CHARFORMAT2 cfTitle;
cfTitle.cbSize = sizeof(CHARFORMAT2);
cfTitle.crTextColor = RGB(255, 100, 100);
cfTitle.dwMask = CFM_COLOR | CFM_FACE;
strcpy(cfTitle.szFaceName, "Verdana");

if (SendMessage(GetDlgItem(g_hWnd, IDC_OUTPUT), EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cfTitle) == 0)
MessageBox(g_hWnd, "Failed to set character format!", "SETCHARFORMAT", MB_ICONEXCLAMATION | MB_OK);

Anyone see what im doing wrong? Ive loaded the library, the edit box is displayed, there is text in it, its just that function doesnt do anything for me.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top