Important: The information in this document is obsolete and should not be used for new development.
FindDialogItem
To determine the item number of an item at a particular location in a dialog box, use theFindDialogItemfunction. TheFindDialogItemfunction is also available as theFindDItemfunction.
FUNCTION FindDialogItem (theDialog: DialogPtr; thePt: Point) : Integer;
theDialog- A pointer to a dialog record.
thePt- A point, specified in coordinates local to the dialog box.
DESCRIPTION
If the point specified in the parameterthePtlies within an item,FindDialogItemreturns a number corresponding to the position of that item in the dialog box's item list resource. If the point doesn't lie within the item's rectangle,FindDialogItemreturns -1. If items overlap,FindDialogItemreturns the item number of the first item, in the item list resource, containing the point.This function is useful for changing the cursor when it's over a particular item.
The
FindDialogItemfunction returns 0 for the first item in the item list resource,
1 for the second, and so on. To get the proper item number before calling theGetDialogItemorSetDialogItemprocedure, add 1 toFindDialogItem's
function result, as shown here:
theItem := FindDialogItem(theDialog, thePoint) + 1;Note thatFindDialogItemreturns the item number of disabled items as well as enabled items.