RodneyYeo
asked on
CWnd::GetWindowRgn()
I've tried using the above method but i can't seems to get the value for HRGN and the return value is always ERROR(that is 0). Any clue?
Try to use SetWindowRgn and after that GetWindowRgn.
ASKER
But what's the point of having that method under window? if in the end, I still have to do what VinExpert has suggested. Anyway, thanks for your suggestion MichaelS.
In this way we can test your code. For sure will be more easy to see it directly here.
ASKER
Actually I'm thinking about the reason Microsoft have for putting that method in. Look kinda silly setting and getting the value back again. I'm very sure there must be a specific purpose for this method :)
Didn't catch your last comment, sorry.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry, wanted to post it as a comment and with only one signature, sorry...
You have to create a region and pass the HRGN of that region to CWnd::GetWindowRgn. You can't pass an invalid HRGN to it.
ASKER
Thanks for your information. I got the picture.
ASKER
and thanks for all those who have help in one way or another :)
Yes, I am also facing the same problem. So I will be interested in the answer. But What I am thinking to do is,
Use CWnd::GetClientRect() then using that rectangle
CRgn::CreateRectRgn()
So that I will have the Rgn in CRgn object.
Thanks,