Solved

strange problem with MoveWindow

Posted on 2002-05-20
1
557 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 136
centeredAverage challenge 8 185
modThree challenge 4 103
Is there a simple front-end menu system. 9 118
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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