Solved

SetWindosPos???

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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