// str转CString
std::wstring ConvertStringToLPCWSTR(const std::string& str) {
wchar_t buffer[256]; // or other suitable size
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, buffer, sizeof(buffer) / sizeof(wchar_t));
return std::wstring(buffer);
}
int main{
std::wstring str = ConvertStringToLPCWSTR(args[0]);
SendString(Hwnd, str.c_str(), 100, 200, 1, 0);
}```
02-04
8737
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-21
4470
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-25
698
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)