OWLNext 7.0
Borland's Object Windows Library for the modern age
|
You can construct a TCursor in a number of ways: from an existing TCursor object, from a resource in the current application, from a resource in another application, or explicitly from size and data information.
You can create cursor objects from an existing cursor encapsulated in a TCursor object:
instance in this case should be the instance of the current application. TCursor does not encapsulate the application instance because TCursor objects know nothing about application objects. It is usually easiest to access the current application instance in a window or other interface object.
You can also create a new TCursor object from an existing HCURSOR handle:
This constructor is used to obtain an ObjectWindows object as an alias to a regular Windows handle received in a message.
There are two other constructors that are available only for 32-bit applications:
The first constructor takes two parameters: resBits is a pointer to a buffer containing the cursor data bits (usually obtained from a call to LookupIconIdFromDirectory or LoadResource functions) and resSize indicates the number of bits in the resBits buffer.
The second constructor takes a single parameter, an ICONINFO structure. The constructor creates an icon from the information in the ICONINFO structure. The fIcon member of the ICONINFO structure must be false, indicating that the ICONINFO structure contains a cursor.
The destructor ~TCursor deletes the cursor. If the deletion fails, the destructor throws an exception.