Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 19th, 2006, 2:16 AM   #1
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
Problem with GetClientRect

Hi,

When processing a WM_PAINT message, I run this code (rect is a non-static object of the window procedure function.):
//snip
hdc = BeginPaint(hwnd, &ps);
SelectObject(hdc, GetStockObject(BLACK_BRUSH));
GetClientRect(hwnd, &rect);
//snip
Problem is, the same values end up in rect every time, no matter how much the window is resized. It's correct for the first call of WM_PAINT at the beginning of the program, and then it never changes! Any help?
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot

Last edited by uman; Jul 19th, 2006 at 2:33 AM.
uman is offline   Reply With Quote
Old Jul 19th, 2006, 2:56 AM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
Found my problem, it was a stupid mistake. That code was in the window procedure of a child window, which is obviously not going to magically change size when the parent window is resized. I've added code in the parent window to change the size of the client window when the parent window is resized, and that fixed the problem.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing icons problem Pedja C# 8 Mar 25th, 2006 9:03 AM
cgi/perl script + IE problem joyceshee Perl 2 Jan 24th, 2006 12:10 PM
problem with user defined class mixed with functions willj729 C++ 4 Oct 9th, 2005 4:26 PM
Variable array problem Hintshigen C 6 Apr 10th, 2005 3:35 PM
string problem when passing in linked list quantz C++ 0 Feb 27th, 2005 11:11 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:40 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC