• Advertisement

Archived

This topic is now archived and is closed to further replies.

Creating a Rich Edit Box with CreateWindowEx

This topic is 5490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I am writing a GUI and want keywords to change color. I am trying to initialise a rich edit box so that I can change the color of the font. I have included commctrl.h and comctl32.lib. I then used the following code
  
//InitCommonControls();


hwndEdit = CreateWindowEx( WS_EX_APPWINDOW, "richedit", NULL,
WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
WS_BORDER | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0, 30, 0, 0,
hwnd, (HMENU) EDITID, hInst, NULL );

  
but this doesnt work. No edit box is created. Do I have to use commctrl.dll and if so how do I load it into my program? Anything else that I have to do. Thanks Ciaran

Share this post


Link to post
Share on other sites
Advertisement
you first have to load the richedit dll manually:

HINSTANCE RichEditDll = LoadLibrary ( "RICHED32.DLL" );


My Homepage
( This post was made entirely from re-cycled electrons )

Share this post


Link to post
Share on other sites

  • Advertisement