Re: Dialog window auto resizing

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



By default dialog units are used to specify sizes in dialog templates(not pixels). I checked the documentation and headers but I couldn't find a way to specify layout in pixels in a dialog template.

To understand this better you might check out the documentation for GetDialogBaseUnits as a starting point.

http://msdn2.microsoft.com/en-us/library/ms929231.aspx

Paul Monson
Intrinsyc


Baranidharan wrote:
Hi Paul,

thanks.Yes, it is an .RC file. and the dialog resource is defined like
this.

IDD_DIALOG1 DIALOG 0, 0, 240, 320
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Select Account",IDC_STATIC,15,8,57,14
COMBOBOX IDC_COMBO1,13,19,166,16,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Close",IDC_BUTTON2,113,167,64,13
END

I run this program and in the WM_INITDIALOG, I do a GetWindowRect
( hDlg, &rect ), I get the dimensions to be 360 x 540 as against 240 x
320.

If this is due to rescaling at runtime based on font size how could i
avoid this ???

Regards
Barani.

On Nov 22, 12:36 am, Paul Monson <pa...@xxxxxxxxxx> wrote:
Is this an .RC file? Could you post an example?

I suspect it could be that your dialog is layed out using dialog units,
which involves rescaling at runtime based on the system font size

Paul Monson
Intrinsyc

Baranidharan wrote:
Thanks a lot for your reply.
My doubt is that , Isnt VS 2005 Dialog editor supposed to WYSIWIG. I
am not resizing the dialog at runtime in the emulator. I just launch
the application but I do not see the dialog as it was in the WYSIWIG.
Is there any scaling involved behind the screens ?
Regards
On Nov 20, 7:30 pm, r_z_aret@xxxxxxxxxxxx wrote:
On Mon, 19 Nov 2007 03:59:16 -0800 (PST), Baranidharan
<baran...@xxxxxxxxx> wrote:
Hi all,
I create a dialog window using the VS 2005 dialog editor, with
dimensions 240 x 320 (manually editing in the resource file) and add
some controls. When I test the dialog appearance using the "Test
Dialog" button things are ok but when I run the application on
emulator ( QVGA mode ) the placement and the sizes of the controls go
haphazard.
Dealing with multiple screen dimensions is becoming more and more
important, and is a somewhat hot topic. For info on my approach, see
my 8 Nov 07 contribution to a thread called " how to implement
resizing for a win32 dialog box" in
microsoft.public.win32.programmer.ui; it's code I use for "big"
Windows _and_ Windows CE platforms such as Pocket PC. I think
Microsoft is making some serious attempts to address the problem with
WPF (Windows Presentation Foundation).
Why is it happening ? What should i do to get it as i see in the
editor ?
Thanks in advance,
Regards
Barani.
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116www.penfact.com

.



Relevant Pages

  • Re: Dialog window auto resizing
    ... Now i get it, thanks paul, ... I checked the documentation and headers but I ... couldn't find a way to specify layout in pixels in a dialog template. ... Windows _and_ Windows CE platforms such as Pocket PC. ...
    (microsoft.public.windowsce.app.development)
  • Re: Executable enty points incorrectly documented
    ... I was speaking about Windows SDK not MSDN Library entirely, but even if Windows SDK conatins C/C++ documentation I believe that main/WinMain belong to C/C++ documentation rather than Windows API documentation. ... It's correct about the default entry point names used by the linker and also correct about what those entry points call and because this is the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: ping Purl Gurl? Beginner Level Perl
    ... This is a good short one page article on perl core buffering, ... a lot of documentation amounted to nothing ... more than tirades about how bad Windows is as an operating system. ...
    (alt.usage.english)
  • Re: installing freebsd on windows
    ... windows vista runs well too on overmuscled hardware. ... Why do I have to Google the info? ... So you're trying to say that all local documentation is useless ... recommending that I do business with them again? ...
    (freebsd-questions)
  • Re: Video Mode 13h in windows XP ... impossible?
    ... out the fluff so they can concentrate on just plotting pixels without ... Actually, running full-screen and not in a window, Windows simply gets ... keys to the video display... ... (some cards do not come with VESA routines so Microsoft, I think, ...
    (alt.lang.asm)