Based on input from Ted & David i put together the following code. It will popup a message if the left edge of the form is close (within errX pixels) to the left edge of the desktop. It will popup a message if the top edge of the forms client area is close (within errY pixels) to the top edge of the desktop. Not pretty, but shows the idea.
void __fastcall TForm1::Button4Click(TObject *Sender)
{
int dWidth = Screen->DesktopWidth;
int dLeft = Screen->DesktopLeft;
int dRight = dWidth + dRight; // deskLeft is 0 if primary monitor is most left monitor
int dTop = Screen->DesktopTop;
int errX = 10; // within 10 pixels is fine enough
int errY = 40; // remember 30 or so pixels for caption bar
TPointF cli(0.0, 0.0);
TPointF sp = ClientToScreen(cli); //sp holds the coordinates for top left of form client area
ShowMessage("X = " + FloatToStr(sp.x) + "\nY = " + FloatToStr(sp.y)); //show coordinates of top/left of form client area
if (dLeft < 0) { //negative value
if ((abs(dLeft)-abs(sp.x)) < errX) {
ShowMessage("Within " + IntToStr(errX) + " pixels of left edge."); // or further left of edge
}
}
else {
if ((dLeft + sp.x)< errX) {
ShowMessage("Within " + IntToStr(errX) + " pixels of left edge."); // or further left of edge
}
}
if (sp.x > 0) { // no need to test the negative case
if ((dRight-sp.x) < errX) {
ShowMessage("Within " + IntToStr(errX) + " pixels of right edge."); // or further right of edge
}
}
if ((dTop + sp.y)< errY) {
ShowMessage("Within " + IntToStr(errY) + " pixels of top edge.");
}
}
This code works regardless of which monitor is primary.
UPDATE 1: This code has problems when the monitors are not aligned along their top edge. In the pic below monitors 1 & 3 have their tops aligned. 2 does not. In this example DesktopTop returned -876. So it seems that David's tip toward "Monitors" is the way to go - in C++ it is "Displays". e.g. TRect myR = Screen->Displays[0].BoundsRect; to get the rectangle of display 0 and then int theTop = myR.top; to find the top of this particular display.

thanks, russ