help me
-
Is there a getclientrect() member function? Just a guess.... -Ken Mazaika
-
Is there a getclientrect() member function? Just a guess.... -Ken Mazaika
GetClientRect returns just the client area. GetWindowRect returns the area of the entire CWnd object. See API docs for CWnd. Best Regards. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
-
#define RectWidth(lprc) ((lprc)->right-(lprc)->left)
#define RectHeight(lprc) ((lprc)->bottom-(lprc)->top)RECT rc;
int width,height;
GetWindowRect(hwndRichEdit,&rc);
width=RectWidth(&rc);
height=RectHeight(&rc);Peter O.
-
#define RectWidth(lprc) ((lprc)->right-(lprc)->left)
#define RectHeight(lprc) ((lprc)->bottom-(lprc)->top)RECT rc;
int width,height;
GetWindowRect(hwndRichEdit,&rc);
width=RectWidth(&rc);
height=RectHeight(&rc);Peter O.
I'm curious as to why you would do it that way. This is not a criticism, just a curiosity. Why couldn't you just use CRect instead? Also, why are you using the globally scoped GetWindowRect rather than the CWnd GetWindowRect? Is there a benefit to doing it that way? Here's the way I would do it:
int width = 0, height = 0;
CRect rect;
GetWindowRect( rect ); // Single parameter CWnd::GetWindowRect
width = rect.Width();
height = rect.Height();Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
-
I'm curious as to why you would do it that way. This is not a criticism, just a curiosity. Why couldn't you just use CRect instead? Also, why are you using the globally scoped GetWindowRect rather than the CWnd GetWindowRect? Is there a benefit to doing it that way? Here's the way I would do it:
int width = 0, height = 0;
CRect rect;
GetWindowRect( rect ); // Single parameter CWnd::GetWindowRect
width = rect.Width();
height = rect.Height();Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
Maybe he isn't using MFC/WTL or doesn't want to force that dependency on others. Tim Smith "Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution." Hoare - 1980 ACM Turing Award Lecture