The first failure occurs at Edit_GetText
. You pass it an uninitialized pointer. You then pass on that same uninitialized pointer to MessageBoxEx
.
Change your code to allocate a buffer:
TCHAR str[255];
Edit_GetText(hEdit1, str, 255);
MessageBoxEx(hwnd, str, _T("INPUT"), MB_ICONINFORMATION, 0);
If you had checked the return value of Edit_GetText
for errors you would have learnt that something was wrong there. Always check return values for errors with the Windows API.