Solved

SetWindosPos???

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 53
How to know only "File created" with EventLog 3 32
withoutTen challenge 14 99
sumHeights2  challenge 7 87
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

24 Experts available now in Live!

Get 1:1 Help Now