Windows 8 Desktop multitouch API - c#

I'm developing a c# touch application for windows 8, desktop mode, and i'm unable to find the best approach to do it. My question is: Should I use the existent Windows 7 Touch API c# or there is a new multitouch c# API that can be used to develop windows 8 desktops apps?
I know that windows 8 have legacy support for the win7 touch api, just need some insight and feedback if still is the best and only way to do it.
Does anyone had a previous experience with this problem?
Edited: I found this article: http://software.intel.com/en-us/articles/touch-gestures , basically the UIElement exposes methods that enable touch manipulation. Maybe this is the way to go. Any thoughts?
Thank you.

Windows 8 API has a new API based on WM_POINTER message see http://msdn.microsoft.com/en-us/library/hh454916(v=vs.85).aspx
Windows 7 API has some drawbacks, see http://the-witness.net/news/2012/10/wm_touch-is-totally-bananas/

WM_TOUCHxxx messages are not prone to this problem:
http://social.msdn.microsoft.com/Forums/en-US/ce6d630a-b345-46ac-88ef-773704986d62/touch-responsiveness-issue-how-to-resolve-jagged-nonsmooth-lines?forum=winappswithcsharp
Both the WM_TOUCHxxx and WM_POINTERxxx message will be prone this this problem:
https://web.archive.org/web/20150709083602/https://connect.microsoft.com/VisualStudio/feedback/details/903760/wpf-touch-services-are-badly-broken
If your c# desktop application is using WPF, your only viable option is to implement your own TOUCHDEVICE that fixes these underlying issues, since it appears Microsoft has decided WPF touch is no longer important.

It depends on what actually are your needs in your app.
If you only want new fast ways to rotate and zoom objects, maybe the WPF Manipulation API is all you need.
If, however, you need to handle multiple fingers on your GUI independently, or in a custom way, you simply handle the usual OnTouchDown, OnTouchMove, and other events.
Please note that, however, multi-touch is only available from inside a single window. In other words: you can multi-touch two objects on the same window, but you won't be able to multi-touch two objects that reside on different windows. If you want multi-touch, multi-window funcionality, you need to:
Use .NET 4.7
Change some configuration in your WPF app

Related

Put the calculator on TopMost C# [duplicate]

I'm developing a Windows 10 Universal app (UWP).
Is it possible to set application as TopMost (always on top)? Like WPF or Winforms (TopMost property).
Thanks
A feature called CompactOverlay mode was added in the Creators Update that supports this type of functionality. When an app window enters compact overlay mode it’ll be shown above other windows so it won’t get blocked. This allows users to continue to keep an eye on your app's content even when they are working with something else. The canonical example of an app taking advantage of this feature is a media player or a video chat app.
A blog post describing the feature can be found here
https://blogs.msdn.microsoft.com/universal-windows-app-model/2017/02/11/compactoverlay-mode-aka-picture-in-picture/
Short answer is no, there is no way as of today to make the application modal.
There is a petition going around asking for this functionality, which was requested last December but given the amount of votes it got (35 at the time this answer was written), it doesn't look like it will be taken into consideration anytime soon.
As mentioned in the comments, this functionality would be PC only so even if it was added, my assumption would be that it wouldn't work outside of the PC mode (so no tablet, mobile or surface family device support).
It's not possible UWP apps have some restrictions compared with WPF of Win32 apps(classic apps).
With uwp apps you need enable some capabilities to do something special in your app as you can see in the link uwp apps need ask for permission or they can't access or modify files directly.
https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx
Best Regards

Which Browser for a Touch-Enabled WPF Application?

I looked at this thread here searching for a Web Browser to embed into a touch-enabled WPF application (on Windows 8 or 10).
I need to support manipulations (meaning be able to zoom, pane, rotate with touch events).
If possible, I would like also to support one of the game frameworks being either Adobe Flash, Unity or Web GL. Or a really working HTML 5 support with touch events.
Investigations performed so far:
- I have tried Awesomium, but I have too many issues with it. I created two questions on their forums two months ago and still don't have any reply.
Also, I tried CEF, but it crashes when the main application is stopped. Also, it does NOT support touch events.
Obviously, I also tried the default WebBrowser, but this one is an ActiveX control so it does not support manipulations.
So, I am about to test dotnetbrowser and EO.WebBrowser. Both require licenses which is less attractive to me but anyway if this the only way to go.
However, none of these browser implementations describe if they support a touch
interface.
Do you have any input on this issue?
Thanks a lot for your help
Best regards
Christophe
Finally I made it work by using a wrapper above CEF called Xilium.CEFGlue.
I could dive into the source code and add the touch support myself.
It works pretty well.
Thanks a lot for your help.
Christophe

How to port existing Windows Store Application to Windows8 Mobile App ?

We have existing Windows Store application which is developed using C# and XAML. We want to port the same to Windows 8 Mobile application. Is there any Guidelines available for this ?
Well at first I would start figuring out the differences
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681690%28v=vs.105%29.aspx
http://blog.markedup.com/2013/07/winrt-windows-phone-8-code-sharing-pitfalls/
When I ported two of my (smaller) apps, I put as much in a PCL (portable class library) as I could. All the stuff that remained in the project itself needed to be rewritten. If you have well-maintainable code, there should be only UI (what you have to adapt anyway) and very few platform specific code (like accessing filesystem, camera or whatever) left. This is the part you must redevelop.
Dnt know how you have made these applications well If you have followed MVVM pattern then it is very easy to port windows and windows phone apps from one to other. You just need to take care of new XAML UIs every thing except some platform specific liberalizes will work. While making any of windows store and windows phone application you should use the liberaries that both platforms can consume. For example you can use LEX.db for the database.
here are very good explanations for it.
sharing code between windows phone and windows 8 app -1
sharing code between windows phone and windows 8 app -2
hope this will help
The answers given so far are quite good. One thing to note is that Windows Phone 8.1 is about to be released, which will share many of the WinRT libraries. This will mean that in a few months (as early as May), the shared libraries between the two platforms will greatly increase. You can download the leaked SDK to see what some of the changes will be.
Not that you should wait until then, and creating a PCL is definitely going to help you (especially if you want to later move to iOS, Android as well). It's just something to keep in mind.

Handle multiple "windows" in Windows Store apps in Windows 8.1

Ok, I have a question to which, despite my best efforts, I have not been able to solve. I searched the internet, and this is one of those that is particularly difficult to search for, but it seems that no user of Windows 8.1 nor any developers developing for Windows 8.1 has posted to any website asking how to do this (I could be wrong, of course).
What I am trying to do is make a Windows Store app targeting Windows 8.1, that takes advantage of multiple Windows. To see what I mean, open up metro ie, right click on a tab, and click "open in new window." This is also in the mail app, where you can open a single message in another window, which behaves like a separate app, and can be snapped like so. It's a new feature of the Windows 8.1 OS.
But I can't for the life of me figure out how to do it in C# and XAML. Does anyone know how? Thanks.
Alex
There are new APIs in Windows.UI.ViewManagement, namely the ApplicationViewSwitcher and ProjectionManager classes. The former is for working with multiple independent views that the user can arrange side by side on whatever monitors they have, which is what IE and Mail use; the latter is for working with multiple monitors.
See the Application Views sample along with the Projection sample for working both scenarios in code.
Might be bit late with my answer, nevertheless I had your similar apprehensions about the "Dismal Support Refs" for this subject, when I first began searching the topic. However I have been able to overcome this and use the feature in my apps. There are some good refs available; The Windows Dev Centre has a Quickstart ie "Quiskstart Creating Multiple Windows", a Good guide is the "MultipleViews" Sample, With the following providing additional support.
1) "Be two places at once using multiple windows" at
https://blogs.windows.com/buildingapps/2014/01/09/be-two-places-at-once-using-multiple-windows/#pBHiQtDSPFrCA7Gv.97
2) "MultipleViews for Windows 8.1 apps" (parts 1-3)
http://www.kraigbrockschmidt.com/2013/11/21/multiple-views-creating-view/
BQ at WATERVIEW

How can I learn a multitouch screen's communication protocol and write a C# application for it?

I have got a monitor with multitouch overlay on top of it. It works fine with Windows 7 but I want to write a multitouch application in C# for Windows XP which doesn't support touch feature out of the box. There is no documentation whatsoever and I emailed the manufacturer but never got a reply.
However the device works with Google Earth, which doesn't natively support multitouch, on Windows XP. So I think it generates many types of messages together i.e. WM_TOUCH for Windows 7, one for Google Earth COM API, and probably its own messages either in UDP or Windows message form. How can I trap all communications and learn the protocol?
OllyDbg is a very low-level debugger that allows you to see a lot of the messages going back and forth on the machine. I've seen it used to reverse-engineer a USB device driver's messages to figure out how to interact with an item.
I suspect that would be an excellent place to start. It should allow you to determine how the messages are being passed and, perhaps, start teasing apart their structure.
There are solutions like Tuio around that do not rely on Windows 7. Maybe a tuio (or alternative) implementation would make you life easier.
I've recently been developing on the Windows 7 platform for multitouch. I'm using UniTuio -- see http://xtuio.com You can look at my question I had to get it working. I'm also using a bridge for Windows 7 called Touch2TUIO, it seems to work quite well. If you need to make the mouse inactive see my question here: using windows 7 with unituio

Categories