Solved

strange problem with MoveWindow

Posted on 2002-05-20
1
560 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

724 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