Code:
#define ADD_THIS "Example"
#define STR_LEN 256
void ProcessCommand(HWND hDlg)
{
char temp[STR_LEN];
if(strcmp(command, "about") == 0)
{
GetDlgItemText(hDlg, IDC_OUTPUT, temp, STR_LEN);
if((lstrlen(temp)+lstrlen(ADD_THIS)) < STR_LEN)
{
strcat(temp,ADD_THIS);
SetDlgItemText(hDlg, IDC_OUTPUT, temp);
}//else error
}
}
or
Code:
#define STR_LEN 256
void ProcessCommand(HWND hDlg)
{
char temp[128],sFinal[256],sAddThis[64]="Add this to the end";//the two smaller strings can't exceed the long one
if(strcmp(command, "about") == 0)
{
if(GetDlgItemText(hDlg, IDC_OUTPUT, temp, 128))//return is number copied into string
{
sprintf(sFinal,"%s %s",temp,sAddThis);
SetDlgItemText(hDlg, IDC_OUTPUT, sFinal);
}//else error
}
}