Link to home
Start Free TrialLog in
Avatar of glenn007
glenn007

asked on

CreateRectRgn ?

First i made a CRect rect, and the inside this one i made this.

......................................................
HRGN hRgn1 = CreateRectRgn(330, 263, 431, 262);    
if(rect.PtInRect(point))
{
     AfxMessageBox( "this is region 1 in rect" );

}

AND THEN A......................................


if(rect.PtInRect(point))
{
     AfxMessageBox( "this is the entire window" );

}

but doesnt matte where my mouse is is give me the afxmessage box from  "The entire window"  it look like it dos no care about the   rgn1
where did i go wrong in this ?


Avatar of AlexFM
AlexFM

Try to change points list:

330, 263, 431, 262

to

330, 262, 431, 263
Avatar of glenn007

ASKER

would not change anything that is the cordinates
inside  rect that is define there

like this...


+----------------------------rect---------------+
-      +330----------+431
-      -             -
-      -    hRgn1    -
-      -             -
-      -             -
-      +263----------+262
-
-               rect
-
+----------------------------rect----------------+


must be something else
maybe then problem is here   if(rect.PtInRect(point)) in the

HRGN hRgn1 = CreateRectRgn(330, 263, 431, 262);    
if(rect.PtInRect(point))
{
    AfxMessageBox( "this is region 1 in rect" );

}



is rect the correct ti write in

if(rect.PtInRect(point)) // should rect be used here ??

{
    AfxMessageBox( "this is region hRgn1  the big rect -rect- " );

}
ASKER CERTIFIED SOLUTION
Avatar of keitha1
keitha1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thx,

one more thing

anyone who got an exsample on how to deviede one rect into 10 small regions in eqaul sizes ?. It seems like it is not logic for me to see HOW the devision is working and what the values should be in
HRGN    hrgn = CreateRectRgn(0, 200, 100,1);
HRGN    hrgn1 = CreateRectRgn(400, 500, 1,1);

if setting thos values the region is comming up in wierd places, and is not easy to see how it then should be  what is the values (   pixel or % of window or else ),  a tutorial would be VERY nice if you have any in this area