{"id":4691,"date":"2014-03-30T14:45:21","date_gmt":"2014-03-30T14:45:21","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-set-background-color-of-window-after-i-have-registered-it-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:45:21","modified_gmt":"2014-03-30T14:45:21","slug":"how-to-set-background-color-of-window-after-i-have-registered-it-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-set-background-color-of-window-after-i-have-registered-it-collection-of-common-programming-errors\/","title":{"rendered":"How to set background color of window after I have registered it?-Collection of common programming errors"},"content":{"rendered":"<p>Short answer: Handle <code>WM_ERASEBKGND<\/code>.<\/p>\n<p>Longer answer:<\/p>\n<p>When you register the WNDCLASS, you&#8217;re providing information about all windows of that class. So if you want to change the color of just one instance of the window, you&#8217;ll need to handle it yourself.<\/p>\n<p>When it&#8217;s time to repaint your window, the system will send your wndproc a <code>WM_ERASEBKGND<\/code> message. If you don&#8217;t handle it, the <code>DefWindowProc<\/code> will erase the client area with the color from the window class. But you can handle the message directly, painting whatever color (or background pattern) you like.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Short answer: Handle WM_ERASEBKGND. Longer answer: When you register the WNDCLASS, you&#8217;re providing information about all windows of that class. So if you want to change the color of just one instance of the window, you&#8217;ll need to handle it yourself. When it&#8217;s time to repaint your window, the system will send your wndproc a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4691","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4691"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4691\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}