How to send a HBITMAP over a socket using WIN32 and C++?
See the question and my original answer on StackOverflowYou can't pass an HBITMAP (which is a HANDLE, a reference pointer in memory) to another machine. You can use the GetBitmapBits Function to transform the HBITMAP into a byte array and send this byte array using send().
On the other side, you'll have to create another compatible bitmap, and use SetBitmapBits Function after the recv().