Hi all!
Where can I find example for using RichEdit control (mainly how to load a .rtf file and display it in the control) which based only on WIN32 (not MFC!!!)
All the examples I have found are based on MFC...
Thanks!!
Printable View
Hi all!
Where can I find example for using RichEdit control (mainly how to load a .rtf file and display it in the control) which based only on WIN32 (not MFC!!!)
All the examples I have found are based on MFC...
Thanks!!
Here: http://home.perm.ru/strannik/#engl
See Demo_1_5
But there are some exceptions: it's not a standard C++ compiler, in English examples all identifiers are obfuscated, most of documentation is in Russian. But I've learned WinAPI on this compiler.
Make sure you load library richedit32.dll or latest version richedit20.dll before creating richedit control.
create rich edit using simple CreateWindowEx
Code:int unique_ID = WM_USER+200;
//parenthwnd is assumed dialog handle
hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,
"RICHEDIT","RichTextBox",
WS_TABSTOP|WS_CHILD | WS_VISIBLE,
100,100,300,300,
parenthwnd,
(HMENU)unique_ID,GetModuleHandle(NULL),NULL
);
TCHAR * newRTF;
//load entire file contents in variable newRTF;
SETTEXTEX se;
se.codepage = CP_ACP;
se.flags = ST_DEFAULT; //inSelection ? ST_SELECTION :
SendMessage(hwnd,EM_SETTEXTEX, (WPARAM)&se,(LPARAM)(LPTCSTR)newRTF);
I hope it helps
There are plenty of samples in MSDN...