Solved

SetWindosPos???

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

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 105
haveThree challenge 22 127
twoTwo  challenge 35 120
wordmultiple challenge 12 170
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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…
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.

752 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