Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码:
MessageBox(NULL, NULL, (LPCWSTR)FindWindow(NULL, L"Untitled - Notepad"), MB_OK);
如何使消息框的标题成为记事本的窗口句柄?有没有任何有效和简单的方法可以使用 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);