{"id":630,"date":"2010-05-24T12:37:45","date_gmt":"2010-05-24T00:37:45","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=630"},"modified":"2010-05-24T12:38:43","modified_gmt":"2010-05-24T00:38:43","slug":"shautocomplete-calling-once-calling-twice","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/630\/","title":{"rendered":"SHAutoComplete: Calling Once, Calling Twice&#8230;"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute]<\/span><\/span><p>The usually exhaustively complete Raymond Chen over-looked a crucial factor in his most recent posting on his excellent\u00a0<a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/\"><em>Old New Thing Blog<\/em><\/a> regarding\u00a0<strong>SHAutoComplete<\/strong>.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" style=\"border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: dotted; border-top-color: #cccccc; display: block; width: 846px; height: 12px; margin-top: 15px; background-image: url(https:\/\/www.deltics.co.nz\/blog\/wp-includes\/js\/tinymce\/plugins\/wordpress\/img\/more_bug.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; background-position: 100% 0%; background-repeat: no-repeat no-repeat;\" title=\"More...\" src=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-includes\/js\/tinymce\/plugins\/wordpress\/img\/trans.gif?w=640&#038;ssl=1\" alt=\"\" \/>In his post he discusses a technique for disabling auto-complete in a common dialog, but along the way discusses why calling\u00a0<strong>SHAutoComplete<\/strong> twice cannot be used to remove flags previously applied. \u00a0As I say, Raymond normally is very precise and exhaustive in his coverage, \u00a0often pre-empting &#8220;nit pickers&#8221; by calling out in advance anything and everything wrong with a question or with approaches that are implied in the question (or in his answer).<\/p>\n<p>In this case, I would have expected him to draw particular attention to the warning in the\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb759862(v=VS.85).aspx\">MSDN docs for SHAutoComplete<\/a>:<\/p>\n<blockquote><p><strong>&#8220;SHAutoComplete<\/strong> should not be called more than once with the same\u00a0<strong>HWND<\/strong>. Doing so results in a memory leak.&#8221;<\/p><\/blockquote>\n<p>But far from it &#8211; he actually\u00a0<span style=\"text-decoration: underline;\">advocates<\/span> calling\u00a0<strong>SHAutoComplete<\/strong> a second time to modify flags if needed!<\/p>\n<p>Sadly, comments are currently disabled on\u00a0<em>The Old New Thing<\/em> due to an extraordinarily lengthy upgrade process being carried out on the underlying blogging system, so I was unable to draw attention to this (and no doubt earn myself a\u00a0<strong>Nit Picker<\/strong> &#8220;badge&#8221; in the process), but in this case I think it&#8217;s worth highlighting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute]<\/span><\/span>The usually exhaustively complete Raymond Chen over-looked a crucial factor in his most recent posting on his excellent\u00a0Old New Thing Blog regarding\u00a0SHAutoComplete. In his post he discusses a technique for disabling auto-complete in a common dialog, but along the way discusses why calling\u00a0SHAutoComplete twice cannot be used to remove flags previously applied. \u00a0As I say, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,1],"tags":[108,292,106,107,105,104],"class_list":["post-630","post","type-post","status-publish","format-standard","hentry","category-delphi","category-general","tag-auto-complete","tag-delphi","tag-msdn","tag-old-new-thing","tag-shautocomplete","tag-shell"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-aa","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=630"}],"version-history":[{"count":2,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/630\/revisions"}],"predecessor-version":[{"id":632,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/630\/revisions\/632"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}