I am trying create an edit box using the Windows API. Here is the code I'm using:
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);
(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.