- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如何将 vector 字符串的值传递给 C++ 中的 win32 函数 SetWindowText。
到目前为止,这是我的代码:
vector <string> filelist;
string path;
path = Text;
filelist = GetPath(path);
SetWindowText(EditShow,filelist);
最佳答案
您可以将它们全部连接成一个字符串并将其作为 C 字符串传递:
#include <sstream> // for std::stringstream
#include <algorithm> // for std::copy
#include <iterator> // for std::ostream_iterator
std::stringstream buffer;
std::copy(filelist.begin(), filelist.end(),
std::ostream_iterator<std::string>(buffer, "\n");
SetWindowText(EditShow,buffer.str().c_str());
关于c++ - 将 vector 字符串的值传递给 C++ 中的 win32 函数 SetWindowText,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5309296/
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
是否可以在 Windows api 的文本框中使用 SetWindowsText() 显示一维值数组? 例如。 SetWindowText(hwndStatic3, sArray); ********
我们正在为现有的 VB6 应用程序编写一个插件(通过 COM 互操作),我们需要一些他们不支持的功能。如果我们能以某种方式接收一个事件,当特定控件的窗口上的文本发生变化时,我们就可以轻松获得所需的功能
我创建了一个编辑窗口。 我希望一个字符串显示在一行中,另一个字符串显示在另一行中,但我正在执行的代码只显示第二个字符串。下面是我的代码片段: hWndEdit = CreateWindow("EDIT
我知道 SetWindowText 会设置任务栏文本,但它也会设置标题栏的文本(为相同的文本),我想为标题栏和任务栏设置不同的文本。所以我正在寻找一个只会更改任务栏文本的函数。 任务栏文本是指: 最佳
我有如下代码,我的问题是为什么在单元格 A[0][0] setWindowText 中什么都不放? if(LOWORD( wParam ) == 104){ int td; int t
好吧,我有一个编辑控件和一个静态文本控件。当用户单击一个按钮时,我希望程序从编辑控件中获取文本并将其添加到静态文本控件中的文本,然后将该新值设置为静态控件中的文本。所以我有一个函数可以将缓冲区相互附加
我有一个简单的应用程序,我正在读取一些内部变量并将它们发布到菜单上的 EditControl。 这是一个代码片段 case 0: SetWindowText(GetDlgItem( g
我想将使用InternetReadFile下载的utf-8编码的网页源代码转换为windows可以识别的utf-16。 这里是代码片段: HINTERNET hConnect,hSession; ch
在我的 C++ Win32 GUI 应用程序中,我有一个对话框,其中包含一个从对话框模板创建的编辑控件: EDITTEXT IDC_EDIT_Id, X, Y, W, H, ES_MULT
我正在使用 VC9,我有一个 CEdit 控件,其内容在单击按钮时重置为默认测试(例如 - “填充”),然后我调用 CEdit 控件的 SetFocus。问题是光标在默认文本的开头闪烁,我希望它在默认
以下代码片段来自多行 CEdit 控件的 OnChange() 处理程序,该控件设置了“WantReturn”。 void DLG::OnChangeEditPrepareTape() { C
我正在用 Visual C++ 编写一个基本程序,允许用户输入文本,然后程序翻转文本并显示它以供用户复制。该程序运行良好,直到您将输入添加到编辑框。当用户点击翻转文本时,它不会向下翻一行,而是显示\r
如何将 vector 字符串的值传递给 C++ 中的 win32 函数 SetWindowText。 到目前为止,这是我的代码: vector filelist; string path; path
我是一名优秀的程序员,十分优秀!