private static extern IntPtr _SelectObjectSafeHBITMAP(SafeDC hdc, SafeHBITMAP hgdiobj);
 public static IntPtr SelectObject(SafeDC hdc, SafeHBITMAP hgdiobj)
 {
     IntPtr ret = _SelectObjectSafeHBITMAP(hdc, hgdiobj);
     if (ret == IntPtr.Zero)
     {
         HRESULT.ThrowLastError();
     }
     return ret;
 }