CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Location
    Italy
    Posts
    389

    From screen to dialog units

    I tried:
    1) GetDialogBaseUnits (font vary, so there's no way i can use this )
    2) GetTextExtent or GetTextExtentPoint32 with getDC
    3) WM_GETFONT or GetCurrentObject with LOGFONT
    (of course all with MulDiv)

    but no one of these methods give me the right dimensions of a dialog control in dialog units.
    Last edited by kkez; October 28th, 2005 at 10:09 AM. Reason: i don't want the size of a button, i want the size of any control

  2. #2
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: From screen to dialog units

    With GetDialogBaseUnits(), you get the dialog box base units used by Windows when creating dialog boxes.

    You can have the size of a button with GetClientRect() or GetWindowRect() because buttons are child windows.

  3. #3
    Join Date
    Sep 2004
    Location
    Italy
    Posts
    389

    Re: From screen to dialog units

    Quote Originally Posted by olivthill
    With GetDialogBaseUnits(), you get the dialog box base units used by Windows when creating dialog boxes.
    Quote Originally Posted by kkez
    1) GetDialogBaseUnits (font vary, so there's no way i can use this )

    You can have the size of a button with GetClientRect() or GetWindowRect() because buttons are child windows.
    Ok thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured