Solved

strange problem with MoveWindow

Posted on 2002-05-20
1
553 Views
Last Modified: 2013-11-20
The following code works fine in a view when the view is in a splitter window, but when the view is created in an SDI style the child window gets offset by (2,2).

This code is called from a child window.

CRect parentrect;
CWnd *parent=GetParent();
parent->GetWindowRect(parentrect);
CRect myrect;
GetWindowRect(myrect);

myrect -= parentrect.TopLeft();
MoveWindow(myrect);

If the top left corner of the child starts as 491,515 it will end up at 493,517

The only difference is whether the view is created in a splitter window or not.  Any suggestions
0
Comment
Question by:Ashurbanipal
1 Comment
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 100 total points
ID: 7023104
That is the design.

The view also have a non client area of 2 pixel. that is why this is happening.
So u have to get the window style and should consider this style for 2,2 offset.

GOOD LUCK
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 91
no14 challenge 14 62
noX challenge 17 92
ASP.NET C# MessageBox.Show Showing a modal dialog box or form when the application ... 2 104
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now