Get bytes/char* from hIcon/hBitmap
问题 I'm working on a C/S application, Server in C++ and Client in C#, I need to send some information about current running processes and related icon. I get icon file thanks to EnumWindows with this code inside the callback... // Get the window icon HICON hIcon = (HICON)(::SendMessageW(hWnd, WM_GETICON, ICON_SMALL, 0)); if (hIcon == 0) { // Alternative method. Get from the window class hIcon = reinterpret_cast<HICON>(::GetClassLongPtrW(hWnd, GCLP_HICONSM)); } // Alternative: get the first icon