|
-
July 30th, 2009, 06:36 AM
#1
RichEdit based Win32 example
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!!
-
July 30th, 2009, 02:04 PM
#2
Re: RichEdit based Win32 example
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.
-
July 30th, 2009, 11:42 PM
#3
Re: RichEdit based Win32 example
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
-
August 1st, 2009, 01:04 PM
#4
Re: RichEdit based Win32 example
There are plenty of samples in MSDN...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|