{"id":43793,"date":"2014-10-22T07:00:00","date_gmt":"2014-10-22T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2014\/10\/22\/how-do-i-disable-windows-8-touch-contact-visualizations-for-my-application\/"},"modified":"2014-10-22T07:00:00","modified_gmt":"2014-10-22T07:00:00","slug":"how-do-i-disable-windows-8-touch-contact-visualizations-for-my-application","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20141022-00\/?p=43793","title":{"rendered":"How do I disable Windows 8 touch contact visualizations for my application?"},"content":{"rendered":"<p>\nYou might have an application (like a game) where the default\ntouch contact visualizations are a distraction.\nIn WinRT, you can disable the contact visualizations by simply saying\n<\/p>\n<pre>\n\/\/ JavaScript\nWindows.UI.Input.PointerVisualizationSettings.\n    getForCurrentView().\n    isContactFeedbackEnabled = false;\n\/\/ C#\nWindows.UI.Input.PointerVisualizationSettings.\n    GetForCurrentView().\n    IsContactFeedbackEnabled = false;\n\/\/ C++\nWindows::UI::Input::PointerVisualizationSettings::\n    GetForCurrentView()-&gt;\n    IsContactFeedbackEnabled = false;\n<\/pre>\n<p>\nIn Win32, you use the\n<code>Set&shy;Window&shy;Feedback&shy;Setting<\/code> function.\nTo demonstrate that, let&#8217;s take our\n<a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2003\/07\/23\/54576.aspx\">\nscratch program<\/a>\nand make\nthis simple change:\n<\/p>\n<pre>\nBOOL\nOnCreate(HWND hwnd, LPCREATESTRUCT lpcs)\n{\n <font COLOR=\"blue\">BOOL fEnabled = FALSE;\n SetWindowFeedbackSetting(hwnd,\n    FEEDBACK_TOUCH_CONTACTVISUALIZATION,\n    0, sizeof(fEnabled), &amp;fEnabled);<\/font>\n return TRUE;\n}\n<\/pre>\n<p>\nThe touch visualizations are white and the default\nwindow color is white, so the visualizations are hard to see\nin the scratch program.\nLet&#8217;s change the color to something that the visualizations will\nbe more visible against.\n<\/p>\n<pre>\n    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW<font COLOR=\"blue\">TEXT<\/font> <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2014\/03\/05\/10505179.aspx\">+ 1<\/a>);\n<\/pre>\n<p>\nRun the program, and you&#8217;ll see that if you touch the window\nand drag your finger around,\nthere is no little white circle\nand no white streak that follows your finger.\n(Note, however, that the\n<i>Optimize visual feedback for projection to an external monitor<\/i>,\nsetting overrides the\n<code>FEEDBACK_TOUCH_CONTACT&shy;VISUALIZATION<\/code> setting,\nso if you have projection contacts enabled, then you still get the\ndark circles.\nAnother way to get dark circles is to stay up late and not get enough\nsleep.)\n<\/p>\n<p>\nAlthough we disabled contact visualizations,\nwe still get visualizations for gestures like tap\nor tap-and-hold.\nWe can turn those off, too:\n<\/p>\n<pre>\nBOOL\nOnCreate(HWND hwnd, LPCREATESTRUCT lpcs)\n{\n BOOL fEnabled = FALSE;\n SetWindowFeedbackSetting(hwnd,\n    FEEDBACK_TOUCH_CONTACTVISUALIZATION,\n    0, sizeof(fEnabled), &amp;fEnabled);\n <font COLOR=\"blue\">SetWindowFeedbackSetting(hwnd,\n    FEEDBACK_TOUCH_TAP,\n    0, sizeof(fEnabled), &amp;fEnabled);\n SetWindowFeedbackSetting(hwnd,\n    FEEDBACK_TOUCH_DOUBLETAP,\n    0, sizeof(fEnabled), &amp;fEnabled);\n SetWindowFeedbackSetting(hwnd,\n    FEEDBACK_TOUCH_PRESSANDHOLD,\n    0, sizeof(fEnabled), &amp;fEnabled);\n SetWindowFeedbackSetting(hwnd,\n    FEEDBACK_TOUCH_RIGHTTAP,\n    0, sizeof(fEnabled), &amp;fEnabled);<\/font>\n return TRUE;\n}\n<\/pre>\n<p>\nThe complete list of things you can disable is given\nby\n<a HREF=\"http:\/\/msdn.microsoft.com\/library\/hh707350.aspx\">\nthe\n<code>FEEDBACK_TYPE<\/code> enumeration<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might have an application (like a game) where the default touch contact visualizations are a distraction. In WinRT, you can disable the contact visualizations by simply saying \/\/ JavaScript Windows.UI.Input.PointerVisualizationSettings. getForCurrentView(). isContactFeedbackEnabled = false; \/\/ C# Windows.UI.Input.PointerVisualizationSettings. GetForCurrentView(). IsContactFeedbackEnabled = false; \/\/ C++ Windows::UI::Input::PointerVisualizationSettings:: GetForCurrentView()-&gt; IsContactFeedbackEnabled = false; In Win32, you use the Set&shy;Window&shy;Feedback&shy;Setting [&hellip;]<\/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-43793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You might have an application (like a game) where the default touch contact visualizations are a distraction. In WinRT, you can disable the contact visualizations by simply saying \/\/ JavaScript Windows.UI.Input.PointerVisualizationSettings. getForCurrentView(). isContactFeedbackEnabled = false; \/\/ C# Windows.UI.Input.PointerVisualizationSettings. GetForCurrentView(). IsContactFeedbackEnabled = false; \/\/ C++ Windows::UI::Input::PointerVisualizationSettings:: GetForCurrentView()-&gt; IsContactFeedbackEnabled = false; In Win32, you use the Set&shy;Window&shy;Feedback&shy;Setting [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/43793","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=43793"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/43793\/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=43793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=43793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=43793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}