方法一:char str[10]="123123";for (int i=0;i{ ::PostMessage(hwnd2,WM_CHAR,str[i],0); }方法二: char ss[100]="hh"; ::SendMessage(hWnd,WM_SETTEXT,0,(LPARAM)ss);