{"id":42523,"date":"2003-09-13T20:17:00","date_gmt":"2003-09-13T20:17:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2003\/09\/13\/answers-to-exercises\/"},"modified":"2020-04-02T18:07:04","modified_gmt":"2020-04-03T01:07:04","slug":"answers-to-exercises","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20030913-00\/?p=42523","title":{"rendered":"Answers to exercises from Scrollbars Part 10"},"content":{"rendered":"<p><strong>Exercise<\/strong>: Explain why we used 0x7FFF to represent infinite height.<\/p>\n<p><strong>Answer<\/strong>: Commenter &#8220;Reiko&#8221; got this right. 0x7FFF is the maximum integer coordinate supported by Windows 95, 98 and Me.<\/p>\n<p><strong>Exercise<\/strong>: Explain the line <code>rcWindow.bottom += rcTemp.top<\/code>.<\/p>\n<p><strong>Answer<\/strong>: The more precise way of writing the line would have been<\/p>\n<pre>    rcWindow.bottom += (rcTemp.top - rcWindow.top) - (0 - rcWindow.top);\r\n<\/pre>\n<p>The first term is the amount of non-client space consumed at the top of the window. The second term is the amount of non-client space consumed at the top of the window, taking wrapping into account. The difference, therefore is the amount by which <i>AdjustWindowRectEx<\/i> needs to be adjusted. But the two instances of <code>rcWindow.top<\/code> cancel out, leaving just <code>rcTemp.top<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Answers to exercises from Scrollbars Part 10.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-42523","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Answers to exercises from Scrollbars Part 10.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/42523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=42523"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/42523\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=42523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=42523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=42523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}