Isn't it funny that it should happen on your boss' system ?? And scary too..
From the look of it, it appears you are showing a bitmap background and the proiblem seems to be with that not being stretched all the way. Are you doing some sort of background painting for the dialog ?
one say me that this problem come from font size, font is bigger on my boss'pc than on mine, he say that elements's position are base d on font size
he advices me to resize and move each element manually,
but I don't see how I can do to correct it and to get the same screen with differents font size
class CMyDialog:
public CDialog
{
private:
CBitmap m_Background;
int m_iWidth, m_iHeight;
.........
}
CMyDialog::CMyDialog(UINT nIDTemplate, CWnd* pParentWnd, UINT iIDD_Background)
{
m_Background.LoadBitmap(iIDD_Background); // lecture bitmap dans les ressources
BITMAP InfosBackground;
m_Background.GetBitmap(&InfosBackground); // structure d'informations.
m_iWidth = InfosBackground.bmWidth;
m_iHeight = InfosBackground.bmHeight;
CDialog::CDialog(nIDTemplate, pParentWnd);
}
BOOL CMyDialog::OnEraseBkgnd(CDC* pDC)
{
CDC MemDC;
// creation d'un DC en memoire
MemDC.CreateCompatibleDC(pDC);
// selection du bitmap dans le DC en memoire
MemDC.SelectObject(&m_Background);
// transfert final du bitmap dans le dc de la view.
pDC->BitBlt( 0,0,m_iWidth, m_iHeight, &MemDC, 0, 0, SRCCOPY);
return TRUE;
}
then before painting take the height and width with GetClientRect then pase this rectangle to the painting routine; means use the height and width of this rect in painting
In fact, I want all my CDialog to keep exactly size I gave when I developped it and this, whatever is it's configuration (little or big font ....)
Dialog resource templates are an automatism meant to create standard dialogs which adapt in a flexible way to the user's preferences. That's why you design them using dialog units, not pixels. At run-time, the system will convert the dialog size and control positions to pixels, depending on the system font base size the user has chosen in the 'Display' control panel.
If you want to circumvent that automatism, then you can't use dialog resource templates, but need to create and position your controls programmatically to hard-coded pixel positions.
However, keep in mind that users (like your boss, in your example) usually have a good reason for changing the base font size on their system - most likely, they have a very high resolution display, or simply a weaker eyesight. As a result, every normal dialog will be resized accordingly, and all controls are moved and resized for a larger display. It is obvious that if you hard-code your dialog to fixed pixel values and font sizes, your dialog will appear smaller than other dialogs on the system, and possibly be hard to read for the user.
The cheap way out would be to resize your bitmap accordingly (as already suggested by bantisk above). You can avoid most of the loss of image quality if you provide a rather large bitmap and scale it down via StretchBlt(), using HALFTONE as the StretchBlt mode. If you absolutely need to avoid bitmap resizing, you could provide different bitmaps for different font sizes / resolutions, and choose the correct bitmap at run-time.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.