Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem: WM_WINDOWCHANGINGPOS not being sent

Posted on 1999-07-09
7
Medium Priority
?
244 Views
Last Modified: 2010-04-02
I need to override CWnd::OnWindowChangingPos() in my DIALOG app, but the function is not being run because the windows message is not being sent to it...

Why is this and how can I "get it" ?

It might be useful for you to know that the reason I need this is because it is looking like the only way I can hide the dialog once it is running. I've tried ShowWindow(FALSE) and SetWindowPos(), etc inside the OnInitDialog(), but no joy....

Thanks guys
0
Comment
Question by:jhattingh
[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
7 Comments
 
LVL 6

Expert Comment

by:MichaelS
ID: 1199626
Try to use OnSize()
0
 

Expert Comment

by:caiger
ID: 1199627
Just out of curiosity, why are you trying to hide the dialog?

If it is a modal dialog, this would mean that the any other parts of the application would be disabled.

However, if this is a modeless dialog, it should be possible to either create it without the WS_VISIBLE style, or call ShowWindow(FALSE) when it has been created.
0
 
LVL 1

Author Comment

by:jhattingh
ID: 1199628
I don't want to use OnSize() because it doesn't expose the appropriate pointer that I'm after.

The reason I want to hide it is because it is a dialog app which MAY be passed a parameter specifying the app should hide itself.


0
Industry Leaders: 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!

 

Accepted Solution

by:
jbooher earned 120 total points
ID: 1199629
In your OnInitDialog() call SetWindowPos(NULL, 0,0,0,0, SWP_NOMOVE|SWP_NOZORDER);  This will effectively hide the window before it is displayed.

The reason that the ShowWindow() doesn't hide it is because the Modal loop forces it to be displayed.
0
 
LVL 1

Author Comment

by:jhattingh
ID: 1199630
Thanks dude! Can you explain why/how your solution works?

Jason
0
 

Expert Comment

by:jbooher
ID: 1199631
Jason,
The code above sets the Window's Size to 0 pixels by 0 pixels.  
0
 
LVL 1

Author Comment

by:jhattingh
ID: 1199632
duh! (*VERY* sheepish grin)

Thanks dude!
0

Featured Post

Industry Leaders: 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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

688 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