将 HWND 转换为 LPWSTR?
Convert HWND to LPWSTR?
我有以下代码:
MessageBox(NULL, NULL, (LPCWSTR)FindWindow(NULL, L"Untitled - Notepad"), MB_OK);
如何使消息框的标题成为记事本的 Window 句柄?有没有任何有效和简单的方法可以使用 c++ 来做到这一点?
这个:
HWND hwnd = FindWindowW(NULL, L"Untitled - Notepad");
std::wostringstream ss;
ss << std::hex << hwnd;
std::wstring strTitle = ss.str();
MessageBoxW(NULL, L"Caption message", strTitle.c_str(), MB_OK);
我有以下代码:
MessageBox(NULL, NULL, (LPCWSTR)FindWindow(NULL, L"Untitled - Notepad"), MB_OK);
如何使消息框的标题成为记事本的 Window 句柄?有没有任何有效和简单的方法可以使用 c++ 来做到这一点?
这个:
HWND hwnd = FindWindowW(NULL, L"Untitled - Notepad");
std::wostringstream ss;
ss << std::hex << hwnd;
std::wstring strTitle = ss.str();
MessageBoxW(NULL, L"Caption message", strTitle.c_str(), MB_OK);