?
Solved

CreateRectRgn ?

Posted on 2003-03-23
5
Medium Priority
?
300 Views
Last Modified: 2013-11-20
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 ?


0
Comment
Question by:glenn007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8189980
Try to change points list:

330, 263, 431, 262

to

330, 262, 431, 263
0
 

Author Comment

by:glenn007
ID: 8190023
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
0
 

Author Comment

by:glenn007
ID: 8190029
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- " );

}
0
 
LVL 1

Accepted Solution

by:
keitha1 earned 300 total points
ID: 8191846
Use PtInRegion.
0
 

Author Comment

by:glenn007
ID: 8206809
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question