• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Problem: WM_WINDOWCHANGINGPOS not being sent

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
1 Solution
Try to use OnSize()
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.
jhattinghAuthor Commented:
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.

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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.
jhattinghAuthor Commented:
Thanks dude! Can you explain why/how your solution works?

The code above sets the Window's Size to 0 pixels by 0 pixels.  
jhattinghAuthor Commented:
duh! (*VERY* sheepish grin)

Thanks dude!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now