Hi

I can't help thinking there must be an API function around already to tell me if I am over the border of a selected region. Even if not I want to know the most efficient and fastest method to do this in code. I am using the following suedo code:

kinda vb code:
if y=sel_top 'plus or minus 2 and y=sel_top+hieght 'plus or minus 2 then
if x=sel_left 'plus or minus 2 then lineState=0 'lft border
if x=sel_left + width'plus or minus 2 then lineState=1 'rt border
end if
if x>sel_left'plus or minus 2 and x<sel_left+width'plus or minus 2 then
if y=sel_top 'plus or minus 2 then lnState=2 'tp border
if if y=sel_top +height 'plus or minus 2 then lnState=3 'bt border
end if