catching window resize event correctly

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
NaturalDemon
Posts: 97
Joined: October 28th, 2012, 8:28 pm

catching window resize event correctly

Post by NaturalDemon » October 31st, 2012, 8:19 am

Code: Select all

case WM_SIZING:
		{
			
			if (hWnd)
			{   
				pRect = (RECT*)lParam;
				int a = 2 + 3;
				switch( wParam )
				{
					case WMSZ_BOTTOM:
					case WMSZ_BOTTOMLEFT:
					case WMSZ_BOTTOMRIGHT:
					case WMSZ_LEFT:
					case WMSZ_RIGHT:
					case WMSZ_TOP:
					case WMSZ_TOPLEFT:
					case WMSZ_TOPRIGHT:
					{
						RECT r;
						GetClientRect(hWnd, &r);
					break;
					}
				}
			}
		}
		break;
        case WM_SIZE:
                if (wParam == SIZE_MINIMIZED)
                {

                }
                else if (wParam == SIZE_RESTORED)
                {
					RECT r;
                                GetClientRect(hWnd, &r);
                }
                        break;
trying to learn about resize the windowEvent.

hoverever putting a brake point: GetClientRect(hWnd, &r);
returns:
(r).left = -858993460
(r.).top = -858993460
(t).right = -858993460
(r).botton = -858993460

@ certains brakepoints i do get the right data, but moslty not ... i'm doing something the wrong here.
i tried various searches on google ... but ...

my gues is ... i'm to fast ... because the actual data is being delivered.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: catching window resize event correctly

Post by chili » October 31st, 2012, 2:21 pm

Doesn't seem like a it would be a timing problem... especially since GetClientRect is an async function. WinAPI can be really fiddly at time and the documentation can leave a lot to be desired. Let us know if you figure it out bro. :)
Chili

NaturalDemon
Posts: 97
Joined: October 28th, 2012, 8:28 pm

Re: catching window resize event correctly

Post by NaturalDemon » October 31st, 2012, 2:27 pm

chili wrote:Doesn't seem like a it would be a timing problem... especially since GetClientRect is an async function. WinAPI can be really fiddly at time and the documentation can leave a lot to be desired. Let us know if you figure it out bro. :)
i was reading some 3-4 hours about it ...
wel watching code examples from other people .... and as matter of faqt ... they al looked different and claim to do ... the thing.


i gues .... i'll have to figur out a other method ... let me think!

Post Reply