Click here to Skip to main content
11,576,993 members (53,701 online)
Click here to Skip to main content

Tagged as

Convert Dialog Resource Units to Pixels

, 15 Sep 2011 CPOL 9.6K 1
Rate this:
Please Sign up or sign in to vote.
This tip shows you how to convert the dimension values in the .rc file of a dialog into pixels
Given a rectangle rcDlg which contains the rc file coordinates of a dialog resource, use the following code:

CDialog *pDlg = m_pDlg;
 pDlg->MapDialogRect(&rcDlg);
 ::AdjustWindowRectEx(&rcDlg,
                             pDlg->GetStyle(),
        ::IsMenu(::GetMenu(pDlg->GetSafeHwnd())),
                             pDlg->GetExStyle());
 
 pDlg->ClientToScreen(&rcDlg);

P.S. Special thanks goes to Jacques Raphanel for this solution.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mukit, Ataul
Chief Technology Officer Rational Technologies
Bangladesh Bangladesh
Your Lord does not like people who waste by extravagance, and only the righteous C s, and does so in increments, and they are of those people who are mindful of what memory and time has in offer and they waste none of it.

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 15 Sep 2011
Article Copyright 2011 by Mukit, Ataul
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid