Solved

SetWindosPos???

Posted on 1999-01-10
2
352 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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. …
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

21 Experts available now in Live!

Get 1:1 Help Now