Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dialog from within??

Posted on 1998-07-22
2
Medium Priority
?
156 Views
Last Modified: 2013-11-20
Have greated my own dialog class which uses it's own DLGTEMPLATE instead of a resource.
Problem: Ignores the size I send it.
Solution: Called SetWindowPos(...,....,...) from within OnInitDialog() which solves it but this is a sloppy
way of doing it as I'm asked the dimension's early in DLGTEMPLATE ->cx and cy

Bitmap (dimensions 600 x 300);

->cx = 600 // should be width in pixels of a bmp
->cy = 300 // should be height in pixels of a bmp

created window ends up nearly twice as big a the bmp.

 
0
Comment
Question by:CONAN
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 300 total points
ID: 1319553
The problem is that the units in the DLGTEMPLATE are specified in DialogBaseUnits (see GetDialogBaseUnits()), as opposed to device units or pixels. You will need to the conversion ahead of time. By the way, SetWindowPos() uses device units.
0
 

Author Comment

by:CONAN
ID: 1319554
GetDialogBaseUnits() does not return correct dialog base units if the dialog is not using the system font. As the dialog was only displaying a bimap I had'nt included the DS_SETFONT style  flag so I was still getting the wrong result..
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Integration Management Part 2
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

963 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