Click here to Skip to main content
15,895,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Question on Dialog & ComboBox Pin
David Crow25-Feb-10 17:10
David Crow25-Feb-10 17:10 
AnswerRe: Question on Dialog & ComboBox Pin
KingsGambit25-Feb-10 19:21
KingsGambit25-Feb-10 19:21 
AnswerRe: Question on Dialog & ComboBox Pin
David Crow26-Feb-10 4:18
David Crow26-Feb-10 4:18 
QuestionUsing Flashvars in MFC C++ Pin
lesliecasas25-Feb-10 7:36
lesliecasas25-Feb-10 7:36 
QuestionProblem with owner-drawn list box Pin
sashoalm25-Feb-10 6:30
sashoalm25-Feb-10 6:30 
AnswerRe: Problem with owner-drawn list box Pin
Maximilien25-Feb-10 7:41
Maximilien25-Feb-10 7:41 
AnswerRe: Problem with owner-drawn list box Pin
Eugen Podsypalnikov25-Feb-10 20:09
Eugen Podsypalnikov25-Feb-10 20:09 
Questionaccounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44425-Feb-10 6:08
23_44425-Feb-10 6:08 
Do I need to incorporate SM_CYBORDER to catch the border of the horizontal scrollbar or is this value inclusive in SM_CYHSCROLL?


Here is why I am asking
I have a window that I need to know the client height if a scrollbar is present. (horiz scrollbar is not set yet)
GetClientRect returns 292. Using ::GetSystemMetrics(SM_CYHSCROLL) + ::GetSystemMetrics(SM_CYBORDER)
returns 21. Therefore, the window will have a client height of 271 when this window gets a scrollbar.

After the horizontal scrollbar is set I use GetClientRect (which should return 271) It returns 272.

Do I need to incorporate SM_CYBORDER to catch the border of the horizontal scrollbar or is this value inclusive in SM_CYHSCROLL?

GetClientRect is off by one pixel when scrollbar is present

MSDN says SM_CYBORDER = Width and height, in pixels, of a window border. But it doesn't say whether this is already included in the SM_CYHSCROLL value. I saw some code that uses both to determine the scrollbar size so its messing with my head. That pixel may be a misunderstanding of some other factor.

Thanks
AnswerRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
Gwenio25-Feb-10 16:26
Gwenio25-Feb-10 16:26 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44426-Feb-10 3:20
23_44426-Feb-10 3:20 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
Gwenio26-Feb-10 3:59
Gwenio26-Feb-10 3:59 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44426-Feb-10 4:36
23_44426-Feb-10 4:36 
GeneralRe: accounting for the scrollbar GetSystemMetrics(SM_CYBORDER) Pin
23_44426-Feb-10 7:48
23_44426-Feb-10 7:48 
QuestionWho can recommend some UI tools? Pin
Aric Wang25-Feb-10 5:48
Aric Wang25-Feb-10 5:48 
QuestionRe: Who can recommend some UI tools? Pin
Maximilien25-Feb-10 6:21
Maximilien25-Feb-10 6:21 
QuestionHandling A Scrollbar Vertical Scroll command Pin
maycockt24-Feb-10 23:25
maycockt24-Feb-10 23:25 
AnswerRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek25-Feb-10 0:08
protectorNelek25-Feb-10 0:08 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
maycockt25-Feb-10 0:42
maycockt25-Feb-10 0:42 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek25-Feb-10 0:52
protectorNelek25-Feb-10 0:52 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
maycockt25-Feb-10 1:11
maycockt25-Feb-10 1:11 
AnswerRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek25-Feb-10 20:58
protectorNelek25-Feb-10 20:58 
GeneralRe: Handling A Scrollbar Vertical Scroll command [modified] Pin
maycockt25-Feb-10 22:59
maycockt25-Feb-10 22:59 
GeneralRe: Handling A Scrollbar Vertical Scroll command Pin
Nelek26-Feb-10 1:30
protectorNelek26-Feb-10 1:30 
QuestionDrawing In MFC Pin
Jalpa M24-Feb-10 23:24
Jalpa M24-Feb-10 23:24 
AnswerRe: Drawing In MFC Pin
Adam Roderick J24-Feb-10 23:31
Adam Roderick J24-Feb-10 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.