怎么取按钮上的文字? 比如有一个确定按钮,,怎么取“确定“两个字 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是API函数GetWindowText,看msdn吧。 CString str;GetDlgItem(控件ID)->GetWindowText(&str); 错了,是:CString str;GetDlgItem(控件ID)->GetWindowText(str); 找到那个窗口的句柄hwnd然后GetWindowText( HWND hWnd, // handle to window or control LPTSTR lpString, // text buffer int nMaxCount // maximum number of characters to copy);就可以了 同意leeajax(教我学VC) ( ) 的解决办法,先获得按钮的句柄,在调GetWIndowText(); #define IDC_BUTTON 40000//按钮的ID...........CButton *pbutton;CString buttonstring;pbutton = (CButton *)GetDlgItem(IDC_BUTTON);pbutton->GetWindowText(buttonstring);// 请问如何根据位图头和位图数据创建位图? 郁闷,散分 如何在实现文件中(.CPP)声明要使用的DLL函数 请教: 哪里声音测试向导这样的例子(类似msn的测试声音的那个东东) 我不知道打印后出来到底是多大尺寸,请高手指点该如何来保证打印后的大小 兄弟有几个问题,请教各位高手: 如何在VIEW中对MAINFRAME中的函数进行调用?! 连接错误,只能送这些分了 局部变量的问题 ScrollWindow滚动求助 高手给个GPRS猫拨号的例子吧 请问如何生成任务栏上的图标及相应图标的右键菜单项!
GetWindowText,看msdn吧。
GetDlgItem(控件ID)->GetWindowText(&str);
CString str;
GetDlgItem(控件ID)->GetWindowText(str);
然后GetWindowText(
HWND hWnd, // handle to window or control
LPTSTR lpString, // text buffer
int nMaxCount // maximum number of characters to copy
);
就可以了
...........
CButton *pbutton;
CString buttonstring;
pbutton = (CButton *)GetDlgItem(IDC_BUTTON);
pbutton->GetWindowText(buttonstring);//