Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Windows Dialog Issue


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Dom_152   Members   -  Reputation: 184

Like
0Likes
Like

Posted 27 October 2012 - 05:11 PM

I'm having an issue using a dialog resource I've created. In the dialog editor it looks like this:

Posted Image

And if I set the "Overlapped" style on it, it looks like this when I create it at runtime:

Posted Image

But I want this to be a child window so I set the "Child" style on the dialog. However, when I create it at runtime as a child, I get this:

Posted Image

As you can see, the button has decided to move itself down and to the right. This also affects other controls as well as buttons.

The code I'm using to create it is straight forward:
HWND window = CreateDialog(RuntimeEnvironment::ModuleInstance, MAKEINTRESOURCE(dialogResource), mMainWindow, WindowHandler::DialogProcedure);
ShowWindow(window , SW_SHOW);
RECT dialogSize;
GetWindowRect(window , &dialogSize);

Incidentally, the rectangle I get from the dialog is completely wrong too; it's far too big.

Does anyone know of any Windows behaviour that would cause this to occur and if so, how to prevent it?

Edited by Dom_152, 28 October 2012 - 06:55 AM.

It's not a bug... it's a feature!

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS