What is the best way to convert HWND to Hex String in C++, I mean also with a "0x" prefix?
HWND hWnd = FindWindow(L"Notepad", L"Untitled - Notepad");
MessageBox(nullptr, LPCWSTR(hWnd), L"Hello World!", MB_ICONINFORMATION | MB_OK | MB_DEFBUTTON1);
But I expect this to output 0x00000000 (assuming Notepad windows is not open) , but it always returns an empty string.
I also tried this answer, but I ended up with returning 0000000000000000.
Anyone can help me on that conversion?