I am trying create an edit box using the Windows API. Here is the code I'm using:
(Variable decalarations and includes are ommitted, but they are in the original code.) According to MSDN this is the correct wat to do it, but my compiler is telling me ICC_STANDARD_CLASSES isn't defined. It's supposed to be defined in commctrl.h which I did include properly, but it just isn't there. On top of that, the other control classes it mentions for use with those seem to work fine. I've tried this with multiple compilers and the same thing always happens. Does anyone know what the heck is going on here? Also, if you don't know the problem then can you at least reccomend an alternative method for creating an edit box. One thing though, I have to do it without using a recource script.Code://Initialize the Edit Control Class ecc->dwSize = sizeof(LPINITCOMMONCONTROLSEX); ecc->dwICC = ICC_STANDARD_CLASSES; if(!InitCommonControlsEx(ecc)) { MessageBox(NULL, "Edit Box Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } //Create the Edit Box hwnd_edit = CreateWindowEx( 0, EDIT, "Test", ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 0, 0, 100, 100, hwnd_main, NULL, GetModuleHandle(NULL), NULL);



LinkBack URL
About LinkBacks



. I really don't get what's going on, it seems like the documentation is being self conflicting. Could someone with a little more experience in windows programming explain it to me?
. You don't even get a scroll bar automatically this way... Oh btw, I also forgot to set the edit box to WS_VISABLE and WS_CHILD but I figured that out pretty quickly. Ok, so now that I've got that resolved, a few quick questions about edit box formatting. First, how do you end a line when setting the edit box text? I want to dispay a few paragraphs of text and making a new line by spacing it out is just plain messy. Second, Is it possible to make some text italic or bold while leaving other text normal? (Never mind this if it can only be done with a Rich Edit control. I see no need to set up one of those for a simple disclaimer like this.) I know how to change the font, but that has to be aplied in an all or none fashion. And last, how to you change the background color of the edit box? That last one may be a bit more complicated than I bargined for, but I don't think the grey backround of a static text box looks very good.