Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Thu, 01 Feb 2007 09:05:17 -0500
Charlie Hoo wrote:
Hello, Scott,
Thank you for your reply. When DPI is changed from 96 to 120, the size of buttons in IE is not changed, could you tell me how to do it?
Actually I am using MoveWindow at runtime to change the size (in pixels) of any control when resized, but it seems not working for changing DPI.
Thanks again for your help.
Charlie
The buttons in IE are not the standard button control. They are simply images on the toolbar window. The size does not change when DPI is changed because they use images, not the system font. To use this kind of toolbar yourself lookup "ToolbarWindow32" or CToolbar.
For resizing your standard buttons, I would suppose that a message is sent to your application when DPI is changed. I don't know what message, but you could investigate this with the Spy++ tool to discover the message and where it is received, then you could resize when you receive the message.
--
Scott McPhillips [VC++ MVP]
.
- Follow-Ups:
- Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- From: Joseph M . Newcomer
- Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- From: Charlie Hoo
- Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- From: David Ching
- Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- References:
- Prev by Date: #pragma deprecated
- Next by Date: Re: #Pragme deprecated
- Previous by thread: Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- Next by thread: Re: CButton and CEdit control's size is different between 96 DPI and 120 DPI for the same number of pixels
- Index(es):