Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

CreateRectRgn ?

Posted on 2003-03-23
5
Medium Priority
?
306 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
  • 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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

564 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