Solved

strange problem with MoveWindow

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 181
xyBalance chalenge 58 93
how do i create updater to My Activex application? 3 87
wordcount challenge 11 121
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

776 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