Border size
-
Hello, How can I detect the border sizes of an MFC dialog? I want to draw something on the dialog bar. First I resize the dialog to some run-time detected size. Then I want to re-position and redraw some controls inside accordingly. The upper boundary is OK since the first pixel of the dialog is defined as (0,0) for the client. But for example, if I click on the leftmost pixel (or convert it with ScreenToClient() since I know the start point of the dialog) of the left border I get (-3,y) as the client value. Then I can say that the thickness of the vertical border of the dialog is 3. Can I be sure that the lower border thickness is the same as the vertical ones? Or is there some function to diagnose it (regarding that it will change w.r.t. your Windows settings)? I would appreciate any help :~ Thanks in advance caykahve
-
Hello, How can I detect the border sizes of an MFC dialog? I want to draw something on the dialog bar. First I resize the dialog to some run-time detected size. Then I want to re-position and redraw some controls inside accordingly. The upper boundary is OK since the first pixel of the dialog is defined as (0,0) for the client. But for example, if I click on the leftmost pixel (or convert it with ScreenToClient() since I know the start point of the dialog) of the left border I get (-3,y) as the client value. Then I can say that the thickness of the vertical border of the dialog is 3. Can I be sure that the lower border thickness is the same as the vertical ones? Or is there some function to diagnose it (regarding that it will change w.r.t. your Windows settings)? I would appreciate any help :~ Thanks in advance caykahve
See
GetSystemMetrics()
. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com -
Hello, How can I detect the border sizes of an MFC dialog? I want to draw something on the dialog bar. First I resize the dialog to some run-time detected size. Then I want to re-position and redraw some controls inside accordingly. The upper boundary is OK since the first pixel of the dialog is defined as (0,0) for the client. But for example, if I click on the leftmost pixel (or convert it with ScreenToClient() since I know the start point of the dialog) of the left border I get (-3,y) as the client value. Then I can say that the thickness of the vertical border of the dialog is 3. Can I be sure that the lower border thickness is the same as the vertical ones? Or is there some function to diagnose it (regarding that it will change w.r.t. your Windows settings)? I would appreciate any help :~ Thanks in advance caykahve
"(GetWindowRect - GetClientRect)/2" Professional C++ libraries for getting images from any TWAIN or DirectShow compatible device on www.neatcpp.com
-
See
GetSystemMetrics()
. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.comThanks! How I exactly got the border:
int HBorder = GetSystemMetrics(SM_CXDLGFRAME);
int VBorder = GetSystemMetrics(SM_CYDLGFRAME); //Left border thickness is equal to right border
int CaptionHeight = GetSystemMetrics(SM_CYCAPTION);
int UpperBorder = CaptionHeight + HBorder;