Q:

GetWindowText() function is not taking / outputting any text from INPUT ("EDIT" type window)

I have been making a feedback form and need to record data to a text file. To do that, I am using WIN32 (windows.h) in ANSI(?) C programming (not C++, and C#)  and compiling the code in CODE::BLOCKS using GNU compiler. 
The problem I am facing is that I am not able to record the Data input form any "EDIT" child windows (line 15: HWND NAME,ROLLNO,CASE_REPORT) so that I can have a message box print them whenever the user presses the "SAVETXT" button.
I don't know how to have a snippet of code here, so I am pasting entire problematic code in the question.
     #if defined(UNICODE) && !defined(_UNICODE)
        #define _UNICODE
    #elif defined(_UNICODE) && !defined(UNICODE)
        #define UNICODE

#endif

#include <tchar.h>
#include <windows.h>

//Global Variables are declared here
#define ID_CANCEL 1
#define ID_SENDRPT 2
#define ID_SAVETXT 3
int WINWIDTH=460,WINHEIGHT=600;                                                                                 //Window Width and Window Height
HWND NAME,ROLLNO,CASE_REPORT,BTN_SEND,BTN_CANCEL,BTN_SAVE;                                                      //Declaring names of various elements
HWND NAME_LABEL,ROLLNO_LABEL,LABEL_WARNING,LABEL_CASE_REPORT,LABEL_EMAIL_INFO;                                  //for our application
int _inputy=20,_rollnoy=_inputy+21,_case_report_y=_rollnoy+21;                                                  //Position information for our elements

/*Declaration of User Defined Functions*/
void AGIMIX_MB_INFO(HWND hwnd,const char *_title,const char *_message);
void AGIMIX_MB_ERROR(HWND hend, const char *_title, const char *_message);
void AGIMIX_USR_INPUT(HWND hnd,HWND hwnd, const char *_default_text,int _xpos,int _ypos,int _length,int _ht);
void AGIMIX_PUT_TXT(HWND hnd,HWND hwnd, const char *_text,int _xpos,int _ypos,int _length,int _ht);
void AGIMIX_PUT_BUTTON(HWND hnd,HWND hwnd,HMENU _identify, const char *_text,int _xpos,int _ypos,int _length,int _ht);
void AGIMIX_USER_TXTFIELD(HWND hnd,HWND hwnd, const char *_text,int _xpos,int _ypos,int _length,int _ht);
/*  Declare Windows procedure  */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/*  Make the class name into a global variable  */
TCHAR szClassName[ ] = _T("AGIMIX_WINDOWS_APP_FEEDBACK");
char *input_name;
int WINAPI WinMain (HINSTANCE hThisInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR lpszArgument,
                     int nCmdShow)
{
    HWND hwnd;               /* This is the handle for our window */
    MSG messages;            /* Here messages to the application are saved */
    WNDCLASSEX wincl;        /* Data structure for the windowclass */
 /* The Window structure */
    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
    wincl.cbSize = sizeof (WNDCLASSEX);

    /* Use default icon and mouse-pointer */
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default colour as the background of the window */
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND+5;

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClassEx (&wincl))
        return 0;

    /* The class is registered, let's create the program*/
    hwnd = CreateWindowEx (
           0,                   /* Extended possibilities for variation */
           szClassName,         /* Class name */
           _T("AGIMIX FEEDBACK FORM"),       /* Title Text */
           WS_OVERLAPPED|WS_SYSMENU, /* default window */
           CW_USEDEFAULT,       /* Windows decides the position */
           CW_USEDEFAULT,       /* where the window ends up on the screen */
           WINWIDTH,                 /* The programs width */
           WINHEIGHT,                 /* and height in pixels */
           HWND_DESKTOP,        /* The window is a child-window to desktop */
           NULL,                /* No menu */
           hThisInstance,       /* Program Instance handler */
           NULL                 /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (hwnd, nCmdShow);

    /* Run the message loop. It will run until GetMessage() returns 0 */
    while (GetMessage (&messages, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&messages);
        /* Send message to WindowProcedure */
        DispatchMessage(&messages);
    }

    /* The program return-value is 0 - The value that PostQuitMessage() gave */
    return messages.wParam;
}

/*  This function is called by the Windows function DispatchMessage()  */

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
    case WM_CREATE:                                                                                                                                         //What to do when the application window is created
       AGIMIX_MB_INFO(hwnd,"AGIMIX [INFORMATION]","Welcome");                                                                                               //Welcome user with a Message Box
       AGIMIX_MB_ERROR(hwnd,"AGIMIX [WARNING: TRIAL VERSION]","This is a Educational / Trial version only, No functionality is supported!");                //Warn user about limited functionality
       AGIMIX_PUT_TXT(LABEL_WARNING,hwnd," All fields marked with \' * \' are compulsory",0,0,450,19);                                                      //STATIC type to Warn user about compulsory fields to be filled
       AGIMIX_PUT_TXT(NAME_LABEL,hwnd," NAME (FULL CAPS)*: ",0,_inputy,150,20);                                                                             //STATIC type to prompt user for his Name in Full Capital letters
       AGIMIX_USR_INPUT(NAME,hwnd,"",150,_inputy,300,20);                                                                                                   //EDIT type text-field to take input from user
       AGIMIX_PUT_TXT(ROLLNO_LABEL,hwnd," LICENCE NUMBER*: ",0,_rollnoy,150,20);                                                                            //STATIC type to prompt user for his Licence Number
       AGIMIX_USR_INPUT(ROLLNO,hwnd,"",150,_rollnoy,300,20);                                                                                                //EDIT type text-field to take input from user
       AGIMIX_PUT_TXT(LABEL_CASE_REPORT,hwnd," FEEDBACK / COMPLAINT*: ",0,_case_report_y,450,20);                                                           //STATIC type to prompt user for his complaint / feedback information
       AGIMIX_USER_TXTFIELD(CASE_REPORT,hwnd,"",0,_case_report_y+21,450,350);                                                                               //EDIT type text-field with added functionality of Multi-line input and Scrolling for inputting detail feedback / complaint
       AGIMIX_PUT_TXT(LABEL_EMAIL_INFO,hwnd,"     Feedback will be responded to Registered Email with Licence.",0,_case_report_y+380,450,21);               //STATIC type to warn user about preregistered email response to the complaint
       AGIMIX_PUT_BUTTON(BTN_SEND,hwnd,(HMENU)ID_SENDRPT,"SEND",50,_case_report_y+430,100,50);                                                              //BUTTON type input for Sending information to AGIMIX server
       AGIMIX_PUT_BUTTON(BTN_SAVE,hwnd,(HMENU)ID_SAVETXT,"SAVE TXT",170,_case_report_y+430,100,50);                                                         //BUTTON type input for Saving the information in a (.txt) file
       AGIMIX_PUT_BUTTON(BTN_CANCEL,hwnd,(HMENU)ID_CANCEL,"CANCEL && EXIT",290,_case_report_y+430,105,50);                                                  //BUTTON type input to Cancel the current complaint/feedback and exit the window/application
                                                                                                                                                            //3 GetWindowText(NAME,input_name,50);
    break;

    case WM_COMMAND:
        //TCHAR input_name[100];
        if(LOWORD(wParam) == ID_CANCEL)
        {
            AGIMIX_MB_ERROR(hwnd,"AGIMIX [WARNING: TRIAL VERSION]","This is a Educational / Trial version only, No functionality is supported!");           //Warn user about limited functionality
            AGIMIX_MB_INFO(hwnd,"AGIMIX [INFORMATION]","Exit Success! Bye.");                                                                               //Give user a parting Message
            PostQuitMessage (0);                                                                                                                            /* send a WM_QUIT to the message queue */
        }
        if(LOWORD(wParam) == ID_SENDRPT)
        {
            AGIMIX_MB_INFO(hwnd,"AGIMIX [FUNCTION SUPPORT]","Function is not supported as of now and will be available later!");
        }
        if(LOWORD(wParam) == ID_SAVETXT)
        {
            GetWindowText(NAME,input_name,50);
            AGIMIX_MB_INFO(hwnd,input_name,input_name);
            SetWindowText(hwnd,input_name);
            AGIMIX_MB_INFO(hwnd,"AGIMIX [ENTERED INFO]",input_name);
            AGIMIX_MB_INFO(hwnd,"AGIMIX [FUNCTION SUPPORT]","Function is not supported as of now and will be available later!");
        }
    break;

    case WM_DESTROY:                                                                                                                                        //What to do when the user exits the application
            AGIMIX_MB_ERROR(hwnd,"AGIMIX [WARNING: TRIAL VERSION]","This is a Educational / Trial version only, No functionality is supported!");           //Warn user about limited functionality
            AGIMIX_MB_INFO(hwnd,"AGIMIX [INFORMATION]","Exit Success! Bye.");                                                                               //Give user a parting Message
            PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
    break;

    default:                          /* for messages that we don't deal with */
            return DefWindowProc (hwnd, message, wParam, lParam);
    }
    return 0;
}
// User Defined Functions for easy functionality
void AGIMIX_MB_INFO(HWND hwnd,const char *_title,const char *_message)
{
    MessageBox(hwnd,_message,_title,MB_ICONINFORMATION|MB_OK);
}

void AGIMIX_MB_ERROR(HWND hwnd, const char *_title, const char *_message)
{
    MessageBox(hwnd,_message,_title,MB_ICONERROR|MB_OK);
}

void AGIMIX_USR_INPUT(HWND hnd,HWND hwnd, const char *_default_text,int _xpos,int _ypos,int _length,int _ht)
{
    hnd = CreateWindow("EDIT",_default_text,WS_VISIBLE|WS_CHILD|WS_BORDER,_xpos,_ypos,_length,_ht,hwnd,NULL,NULL,NULL);
}

void AGIMIX_PUT_TXT(HWND hnd,HWND hwnd, const char *_text,int _xpos,int _ypos,int _length,int _ht)
{
    hnd = CreateWindow("STATIC",_text,WS_VISIBLE|WS_CHILD,_xpos,_ypos,_length,_ht,hwnd,NULL,NULL,NULL);
}
void AGIMIX_USER_TXTFIELD(HWND hnd,HWND hwnd, const char *_text,int _xpos,int _ypos,int _length,int _ht)
{
    hnd = CreateWindow("EDIT",_text,WS_VISIBLE|WS_CHILD|WS_BORDER|ES_MULTILINE|ES_AUTOVSCROLL|WS_VSCROLL,_xpos,_ypos,_length,_ht,hwnd,NULL,NULL,NULL);
}
void AGIMIX_PUT_BUTTON(HWND hnd,HWND hwnd,HMENU _identify, const char *_text,int _xpos,int _ypos,int _length,int _ht)
{
    hnd = CreateWindow("BUTTON",_text,WS_VISIBLE|WS_CHILD|WS_BORDER,_xpos,_ypos,_length,_ht,hwnd,_identify,NULL,NULL);
}

Basically, whenever the user presses any of the "SEND" or "SAVETXT" buttons, the content in "NAME", "ROLLNO" and "CASE_REPORT" windows should be recorded in char *input_name (LINE 31) variable(s) for further processing such as MessageBox() or saving a txt file.

A:

There are several probles in your code:

input_name is a pointer that has never been initialized, therefore it points nowhere. You should have TCHAR input_name[100]; or so instead.
in AGIMIX_USR_INPUT modifying hnd is pointless, parameters are passed by value in C. Instead you should return the created window handle, see below

Corrected AGIMIX_USR_INPUT function
HWND AGIMIX_USR_INPUT(HWND hwnd, const char *_default_text, int _xpos, int _ypos, int _length, int _ht)
{
  return CreateWindow("EDIT", _default_text, WS_VISIBLE | WS_CHILD | WS_BORDER, _xpos, _ypos, _length, _ht, hwnd, NULL, NULL, NULL);
}

Call it like this:
NAME = AGIMIX_USR_INPUT(hwnd, "", 150, _inputy, 300, 20);

The same is valid for the other similar AGIMIX_ functions.
Call GetWindowText likes this:
GetWindowText(NAME, input_name, _countof(input_name));

A few other points:

you shouldn't use all caps identifiers. Only macros are supposed to be written in all caps. This is a convention in C.
you should break up your code into several simpler functions.
you're mixing up TCHAR and char. You program will work if you compile it in ANSI mode, but it won't even compile in UNICODE.
you should format the variable declarations properly, it's a big mess right now.

