Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dialog from within??

Posted on 1998-07-22
2
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

705 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