Solved

SetWindosPos???

Posted on 1999-01-10
2
360 Views
Last Modified: 2013-11-20
Hi,

I want to know how to set the position of the window by using the function SetWindowPos(....).

I tried to use this by the following way.

void CCreate2View::OnSize(UINT nType, int cx, int cy)
{
     CFormView::OnSize(nType, cx, cy);

     if (nType==SIZE_RESTORED)
     {
      SetWindowPos(&wndTop,20,20,300,300,SWP_SHOWWINDOW);
     }
}

I want the window can be placed at the position I specificd, not the position I placed the window before maximizing or minimzing it.

Further, I don't know how to check whether the window is maximizing, minimizing or restoring.....Can anyone teach me how to check it? I find that nType will be equal to SIZE_RESTORED whatever I am maximizing, minimizing or restoring thw window.

Thanks!!!



0
Comment
Question by:kkuu
[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
2 Comments
 
LVL 4

Expert Comment

by:pagladasu
ID: 1327477
Check with these values of nType
SIZE_MAXIMIZED  

SIZE_MINIMIZED   


0
 

Accepted Solution

by:
Christ142 earned 50 total points
ID: 1327478
You must handle CChildView instead.
Then you'll know wheter window is  Maximizing or minimizing....
Good luck
0

Featured Post

Independent Software Vendors: 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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

617 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