I try to retrieve the bitmap displayed in a static control with a call to appropriate windows API.
I get a non zero bitmap handle, but the following code generate the exception reported.


imageHandle= SendMessage (handle,STM_GETIMAGE,IMAGE_BITMAP,0);
Bitmap bitmap = Bitmap.FromHbitmap(imageHandle);

System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.


What's the problem?

thanks.