Posted on 2008-10-14
I have created MFC Dialog based application. I placed one button in invisible mode on dialog. In OnInitDialog handler, I am taking the button coordinates by using mybutton.GetWindowRect() function. I am placing the bitmap(CBItmapButton object) in the rectangle area returned by GetWindowRect(). This is fine on development machines and some machines.
But the placement of bitmap is not proper on some different machine resolutions. How to fix this?
//m_mybutton is member variable and attached to button control on dialog
mycbitmapbutton.Create(NULL, WS_VISIBLE | BS_OWNERDRAW| WS_EX_CLIENTEDGE, CRect( rc.left, rc.top ,rc.left + 65 , rc.top+23), this,100);