Skip to main content
GameDev.net gamedev.net
🔒 Locked

Windows Dialog Issue

Started by Bimble Bob Oct 27, 2012 at 11:11 PM 0 replies 1.1k views
Original Post
Bimble Bob
Bimble Bob
I'm having an issue using a dialog resource I've created. In the dialog editor it looks like this:

s5h7kl.png

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

v3k47m.png

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:

eg4ma.png

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?
It's not a bug... it's a feature!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.