獲得檔案頭編輯框中多行文字

2021-06-03 12:19:15 字數 662 閱讀 3118

//獲得檔案頭編輯框中多行文字

//文字行數

int nlinecount;

//當前行

int nline;

//當前行的字串長度

int nlength;

//儲存字串

char szbuf[max_path];;

nlinecount = -1;

nline = -1;

nlength = -1;

nlinecount = ((cedit*)getdlgitem(idc_header_edit))->getlinecount();

for (nline = 0; nline linelength(((cedit*)getdlgitem(idc_header_edit))->lineindex(nline));

((cedit*)getdlgitem(idc_header_edit))->getline(nline,szbuf,max_path);

szbuf[nlength]='\0';

messagebox(szbuf);

}

multiline 多行 ture

want return 回車 ture

vertical scroll 豎起滾動條 true

pb中獲取多行文字編輯框(mle控制項)指定行的內容

api函式定義 function long sendmessage ulong hwnd,uint msg,long wparam,ref string lparam library user32.dll alias for sendmessagea 取第row行的文字 constant long ...

MFC編輯框中追加文字

首先呼叫cwnd getwindowtext函式獲得當前文字,然後呼叫cwnd setwindowtext函式設定追加後的文字。首先呼叫cedit setsel函式選定當前文字的末端,然後呼叫cedit replacesel追加文字。setsel函式的定義如下 void setsel int nst...

讀取檔案並寫入到編輯框中

最近的專案需要讀取某特定格式的檔案,並實時的將文字檔案的內容更新到編輯框中去,現在功能已經實現,特將原始碼發上來,希望能幫助一些人,由於水平不高,可能 的優化度和質量不是很高,見諒!開啟乙個已存在的記事本檔案 cfiledialog dlg true,null,null,ofn hidereadon...