29 " from handle " <<
static_cast<void*
>(handle));
38 Handle =
reinterpret_cast<HCURSOR
>(::CopyIcon(
reinterpret_cast<HICON
>(
static_cast<HCURSOR
>(cursor))));
41 " copied from TCursor " << (
void*)&cursor);
50 Handle = ::LoadCursor(instance, resId);
58 " loaded from resource " << resId);
65 void * andBits,
void * xorBits)
68 Handle = ::CreateCursor(instance, hotSpot.x, hotSpot.y, size.cx, size.cy,
80 Handle = ::CreateIconFromResource(
reinterpret_cast<PBYTE
>(
const_cast<void*
>(resBits)), resSize,
false, 0x00030000);
83 " created from bits (32)");
91 WARN(iconInfo.fIcon,
"TCursor constructor called with ICONINFO::fIcon == true");
92 ICONINFO i = iconInfo;
93 Handle = CreateIconIndirect(&i);
95 TRACEX(OwlGDI,
OWL_CDLEVEL,
"TCursor constructed indirectly @" <<
static_cast<void*
>(
this));
98#if defined(OWL5_COMPAT)
108 Handle = ::CreateIconIndirect((PICONINFO)iconInfo);
121 ::DestroyCursor(
static_cast<HCURSOR
>(
Handle));
132 CHECK(i.fIcon == FALSE);
137 TPoint{
static_cast<int>(i.xHotspot),
static_cast<int>(i.yHotspot)},
161 if (!r || i.fIcon != FALSE)
throw TXGdi(IDS_GDIFAILURE,
GetHandle());
178 auto i = ICONINFOEX{
sizeof(ICONINFOEX)};
180 if (!r || i.fIcon != FALSE)
throw TXGdi(IDS_GDIFAILURE,
GetHandle());
#define WARN(condition, message)
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
TBitmap is the GDI bitmap class derived from TGdiObject.
auto GetInfo() const -> TInfo
Retrieves information about this cursor.
TCursor(HCURSOR handle, TAutoDelete autoDelete=NoAutoDelete)
Creates a TCursor object and sets the Handle data member to the given borrowed handle.
HCURSOR GetHandle() const
Returns the handle of the cursor with type HCURSOR.
auto GetIconInfoEx() const -> ICONINFOEX
Retrieves information about this cursor.
auto GetIconInfo() const -> ICONINFO
Retrieves information about this cursor.
~TCursor()
Destroys a TCursor object.
TGdiBase()
This default constructor sets Handle to 0 and ShouldDelete to true.
void CheckValid(uint resId=IDS_GDIFAILURE)
bool ShouldDelete
Should object delete GDI handle in dtor?
HANDLE Handle
GDI handle of this object.
TPoint is a support class, derived from tagPOINT.
The tagSIZE struct is defined as.
TXGdi(uint resId=IDS_GDIFAILURE, HANDLE handle=0)
Constructs a TXGdi object with a default IDS_GDIFAILURE message.
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
THandle GetHandle() const
Return the instance handle of the library module represented by the TModule obect.
HCURSOR LoadCursor(TResId id) const
Wrapper for the Windows API.
Definition of class TModule.
Object Windows Library (OWLNext Core).
TModule & GetGlobalModule()
DIAG_DECLARE_GROUP(OwlThread)