Well, thatβs only half true. Newlines work fine for the most part, but when I load a file into it, none of the newlines are displayed. Copying text and pasting it into Notepad ++ with the display of all included characters shows that there is a carriage return and a line.
My download code:
void open_file(HWND hwnd,const char* fname){ SendMessage(textbox,WM_SETTEXT,(WPARAM)0,(LPARAM)""); FILE* file=fopen(fname,"r"); fullpath=fname; filename=fullpath.substr(fullpath.rfind('\\')+1,fullpath.length()); int pos; while(!feof(file)){ pos=GetWindowTextLength(textbox); SendMessage(textbox,EM_SETSEL,pos,pos); fread(buffer,2048,sizeof(char),file); SendMessage(textbox,EM_REPLACESEL,false,(LPARAM)buffer);} fclose(file); SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)filename.c_str());}
source share