If hEdit is a global variable, or the GetWindowText() is in the WM_CREATE message thing right under the CreateWindow(), I don't know.
Otherwise, if hEdit is local to the message loop, and you create another HWND called hEdit somewhere else, then novacain is probably right (hEdit = GetDlgItem(hWndMain, EDIT_BOX).
And you should not be doing, as it sounds like you are:
SendMessage(EDIT_BOX, ...)
It should be:
hEdit = GetDlgItem(hwnd, EDIT_BOX);
SendMessage(hEdit, ...);
Hope this helps...