Solved

strange problem with MoveWindow

Posted on 2002-05-20
1
552 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 47
Detect CR LF to each line 12 137
Smart Camera scanning and reading information 3 86
mapAB Challlenge 35 84
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. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

15 Experts available now in Live!

Get 1:1 Help Now