First I verified that the following works correctly:
Code:
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HBRUSH hBrush;
static HWND hEdit;
static LRESULT lResult;
static char buffer[16];
switch (message) /* handle the messages */
{
case WM_CREATE:
hEdit = CreateWindowEx (
0, "EDIT", "", WS_CHILD | WS_VISIBLE,
10, 10, 50, 16,
hwnd, NULL, NULL, NULL);
SendMessage(hEdit, EM_LIMITTEXT, WPARAM(3), 0);
lResult = SendMessage(hEdit,EM_GETLIMITTEXT,0,0);
wsprintf(buffer, "%i", lResult);
MessageBox(hwnd, buffer, "Caption", MB_OK);
break;
All I can really say about your code is that 'num1' seems a bit of a strange HWND to me. Maybe you can show us more code.