Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Converting to dialog units
Lets say I have a dialog box with a button on it. What I'm trying to do is change the buttons position and/or size, relative to its previous position and size.
I use [b]GetWindowRect()[/b] to retrieve the [b]RECT[/b] of the button. I guess the unit I get is pixels. Then I use [b]GetDialogBaseUnits()[/b] and convert from pixels to dialog untis as stated in the [b]Win32 Programmer's Reference[/b] under [b]GetDialogBaseUnits()[/b]. Finally I use [b]MoveWindow[/b] to move and/or resize the button.
Here is where I have trouble. When I try to "move" it to the same position as it allready is (set in the resource file), it should stay in place, but it moves around. What am I doing wrong?
Sorry, I'm not exactly the king when it comes to explaining stuff. :-)
0 · ·