WM_SETTEXT
An application sends a WM_SETTEXT message to set the text of a window. WM_SETTEXT 
wParam = 0;                     // not used; must be zero 
lParam = (LPARAM)(LPCTSTR)lpsz; // address of window-text string 

解决方案 »

  1.   

    EM_SETSEL
    An application sends an EM_SETSEL message to select a range of characters in an edit control. EM_SETSEL 
    wParam = (WPARAM) (INT) nStart;    // starting position 
    lParam = (LPARAM) (INT) nEnd;      // ending position 
     
    Parameters
    nStart 
    Value of wParam. Specifies the starting character position of the selection. 
    nEnd 
    Specifies the ending character position of the selection. 
    Return Values
    This message does not return a value. 
      

  2.   

    WM_SETTEXT消息只能修改EDIT控件的所有内容,无法只修改已选定的内容。
      

  3.   

    SendMessage(hWndEdit,EM_REPLACESEL,0,(LPARAM)szString)
      

  4.   

    呵呵!没有人来看呀!
    Jinbj(无所谓)的答案是对的,111222([email protected])的可不对哟!本来想让大家共同来学习一下的,结果------失策!
      

  5.   

    Programming Windows ,Charles Pezold 
    挺详细的