Skip to main content
GameDev.net gamedev.net
🔒 Locked

How to create Client Rect

Started by cutesiham Oct 9, 2002 at 11:02 PM 3 replies 1.2k views
Original Post
cutesiham
cutesiham
Dear all experts i have a question, how can i set my own client rect instead of using GetClientRect() in Win32API. I attend to create a window to load an image, instead of showing the full size of client rect, i want to create a client rect which size is exactly as the image''s size thank you from damian
niyaw
niyaw
yup. RECT is a struct, and you can set its members to whatever you want. use MoveWindow or SetWindowPos to resize your window to fit the image if you want that.
cutesiham
cutesiham
What m i trying to do is...

Client Rect
|
______|____________________
|--------------|***********|
|--------------|***********|
|--------------|**********----->this area is neither clickable
|--------------|***********| not editable
|--------------|***********|
|**************************|
----------------------------

i hope i clarify my question




[edited by - cutesiham on October 10, 2002 1:59:31 AM]

[edited by - cutesiham on October 10, 2002 2:00:35 AM]

[edited by - cutesiham on October 10, 2002 2:01:23 AM]
David ONeil
David ONeil
The simplest way of doing what you are trying to do (as far as I know) is to simply create a child window the size of the bitmap, place the bitmap on it, and place it wherever you want in the parent. The window procedure for this child will not respond to clicks, etc....
David ONeil
David ONeil
The simplest way of doing what you are trying to do (as far as I know) is to simply create a child window the size of the bitmap, place the bitmap on it, and place it wherever you want in the parent. The window procedure for this child will not respond to clicks, etc....

Now, as for anything you draw behind this parented window, well that''s the real trick. The parent logic can become quite difficult if you have to take precautions about not placing anything there. Otherwise just place away, and not see it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.