OUR NETWORK:MediaSmart Home Sansa Community Explore3DTV TechLore RoboCommunity Dijit Community About UsAdvertiseContact Us

 
Learn about scoring Forum's Raw Score: 1148290.0
December 15, 2008 08:05 AM
Rating (0 votes)
  • 1
  • 2
  • 3
  • 4
  • 5
Rate This!

Member Avatar

Cajon

Member
Joined: 12/14/2008

I want write an WPF application to support Multi-Touch. Such as Zoom effect like iPhone. :)

I had register three window message using follow code.

--------------------------------------------------------------------------

        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
            if (hwndSource != null)
            {
                WM_M_MOUSEDOWN = RegisterWindowMessage(RegisterWindowMessage_WM_LBUTTONDOWN);
                WM_M_MOUSEMOVE = RegisterWindowMessage(RegisterWindowMessage_WM_MOUSEMOVE);
                WM_M_MOUSEUP = RegisterWindowMessage(RegisterWindowMessage_WM_LBUTTONUP);

                hwndSource.AddHook(new HwndSourceHook(WinProc));
            }
        }

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern int RegisterWindowMessage(string msg);

        private string RegisterWindowMessage_WM_MOUSEMOVE = "98c4179f-2fef-11dc-a000-001a6b408264";
        private string RegisterWindowMessage_WM_LBUTTONDOWN = "98c417a0-2fef-11dc-a000-001a6b408264";
        private string RegisterWindowMessage_WM_LBUTTONUP = "98c417a1-2fef-11dc-a000-001a6b408264";

        private int WM_M_MOUSEDOWN;
        private int WM_M_MOUSEMOVE;
        private int WM_M_MOUSEUP;

        protected virtual IntPtr WinProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == WM_M_MOUSEDOWN)
            {
                this.OnStylusMultiDown(new StylusMultiEventArgs(this, wParam, lParam));
            }
            else if (msg == WM_M_MOUSEMOVE)
            {
                this.OnStylusMultiMove(new StylusMultiEventArgs(this, wParam, lParam));
            }
            else if (msg == WM_M_MOUSEUP)
            {
                this.OnStylusMultiUp(new StylusMultiEventArgs(this, wParam, lParam));
            }
            return IntPtr.Zero;
        }

--------------------------------------------------------------------------

But I can not gets the specified message. Why? are all TouchSmart computer support Multi-Touch tech?

Can you give me some simple that support multi-touch and writed by WPF platform. 

Thanks a lot.

Discussion:    Add a Comment | Comments 1-20 of 24 | Latest Comment | 1 2 Next »

December 15, 2008 3:40 PM

The IQ77x series does not support Multi-Touch.

On the IQ500/800 series, only applications that run within HP TouchSmart / SmartCenter.exe will receive the registered messages you are hooking into.

December 15, 2008 6:40 PM

Intresting... Acording to the details from this years PDC, the HP multi touch facilities would only be available on machines running windows7!!!

The in the market ones now that are running XP won't allow multi touch due to the underlyins OS not actually supporting it fully.

Oluf... have you actually had code running that traps and uses these messages? If so i'd be intrested to see it.

Cheers

Shawty

December 15, 2008 6:51 PM

The registered messages are only available to applications that run as hosted applications according to the developer document available from this site.

Windows Vista (or XP for that matter, but the HP TouchSmart ships with Vista) does not have multi-touch messages natively at this point.

And yes, we have code running that traps those messages. For example the Browser within HP TouchSmart 2.0.x: it has a dual-touch panning gesture.

Let me try to say it in a different way: unless you follow the developer documentation for writing a HP TouchSmart hosted application, you won't get these registered messages.

December 16, 2008 4:45 AM

Ahh, i see... i misunderstood the previous in that i thought it was app development in general.

*Scurry's off to play with visual studio and multi touch* :-)

View unverified member's comment - posted by juan

December 28, 2008 2:40 PM

Not sure that question has anything to do with the topic of this thread (which is multi-touch), but the short answer is no to the first two parts, and yes to the third part.

The TouchSmart screen does not work like a Wacom tablet. There is no sensitivity, only contact detection. And the contact detection is actually detection of an interruption of an infrared lightfield, so you don't even really have to touch the screen surface. All you need to do is get close enough for the infrared cameras in the upper corners to see a shadow in the lightfield.

Which actually means that you CAN use the Wacom pen, sort of, but all it will do is function as a stand-in for a finger. The special pressure sensitive part of the pen won't work.

January 3, 2009 6:13 AM updated: January 3, 2009 6:15 AM

Ok, after lots of research it transpires that the touchsmart running vista 64 is capable of multi-touch.

However.... before you all get too excited, it cannot be enabled as a global feature in the OS which is what i think most people expect.

You CAN however have it in your apps on a one to one basis, and outside the touchsmart user interface too in a regular windows app.

How? the answer lies with he touch screen manufacturers "NextWindow" they've kindly provided an API library and documentation, as well as sample programs in C# and C++ so for all those who want to use multi touch in your apps now pop over to

http://www.nextwindow.com/support/application_notes/api.html

and download he files you need.

Iv'e already tried it, and it works great on the IQ512 :-)

Cheers

Shawty

January 3, 2009 12:17 PM

Be advised that the NextWindow hardware may get confused if you run applications that use the libraries from NextWindow alongside with the HP TouchSmart software. You would be sending low-level hardware instructions from two higher-level software stacks at the same time, and there is no telling how the hardware might react to that. I'm not sure bad things will happen, but be advised of the potential issue and proceed with caution.

Regarding the OS-wide multi-touch: Vista doesn't have that capability and never was advertised as having it, so how anyone can have that expectation I'm not sure.

January 3, 2009 7:12 PM

@geek... The impression i get is that most of the developers (Inc me) got the impression that vista had multi touch caps, i (as i asume most of us do now) know that is not the case.

as for running your own apps alongside the touch smart software, the low level messages get delivered directly to your apps message pump, iv'e tested this and it's definately the case. However if your expecting to use the nextwindow libs for applets running as WPF in the touchsmart interface then i'd definately recomend not doing so.

Instead, trap and use the messages as defined at the beginning of this thread. If however your planning to write your own fully fledged desktop apps, and you want at least 2 touch compatability, then use the nextwindow librarys.

Iv'e already tested this in stand alone apps and had no adverse effects what so ever on an IQ512 system.

OS wide multi touch is not going to be available until windows 7, but the videos from PDC 08 gave most of us the idea that it was available under vista as standard.

Cheers

Shawty

January 3, 2009 8:00 PM

Personally, I'm not planning on doing desktop apps, I have my hands full working on the HP TouchSmart software itself (check my profile).

But thanks for trying all this out and telling everyone here about it!

My caution still applies. You'll have two parallel stacks of higher level software talking to the same hardware, and we don't know if that will cause issues down the line. If your experiments have found that there are no problems, great! Hope that stays the case.

January 4, 2009 6:17 AM

Thats ok geek, no need for me to check your profile :-D

Iv'e got a bit of spare time on my hands at present, as for software being developed, well the stuff iv'e been looking at latley has to run outside the touchsmart interface hence why iv'e persued this throughly, the apps iv'e been looking at developing are designed to be the only ones running at the time so i'm not too worried about any adverse effects, however since everything is still working in a co-opretive multitasking fasion then from the experiments iv'e done so far only the top most active apps gets the messages delivered.

Cheers

Shawty

February 18, 2009 10:13 AM

When attempting to run the NextWindow C# sample on an HP TouchSmart IQ500, I get the following error:

((System.BadImageFormatException)e).StackTrace at MultiTouchCSharpSample.Form1.SetConnectEventHandler(NWConnectEventDelegate connectHandler)
at MultiTouchCSharpSample.Form1..ctor() in C:\Users\Sandbox\Desktop\HP-touchsmart\NWMultiTouchCSharpSample_v12\MultiTouchCSharpSample\Form1.cs:line 176
at MultiTouchCSharpSample.Program.Main() in C:\Users\Sandbox\Desktop\HP-touchsmart\NWMultiTouchCSharpSample_v12\MultiTouchCSharpSample\Program.cs:line 19

///////////////////////////////

Any thoughts as to what might be happening?

February 18, 2009 10:44 AM

You may need to compile the sample for a specific "platform", in particular the platform that the NextWindow library was compiled for (probably x86, but I've never used it). You have a choice of x86, x64 and Any CPU (and sometimes Itanium) platforms, I believe.

February 18, 2009 1:43 PM

Thanks. Setting it to x86 was the trick. The platform settings are hidden by default in VS. You have to access throught he Tools/Options menu and set the Show check boxes to get access. Works like a charm now.

February 19, 2009 5:20 AM

Yup... as geek said.

I take it your developing using visual studio 2008 on a x64 platform, but the nextwindow libs are compiled for 32 bit. :-)

You can recompile them for 64 bit, but when i tried that i had problems, so i just opted for setting the compile build to x86 rather than any...

June 9, 2009 7:10 AM

did any one know how to enable the multitouch in Touchsmart Pavilion TX2000 ruuning in Vista??

when i used the Next window drivers, it says 0 touch device connected but TX2000 is multitouch enabled. so kindly help me in solving the issue

Lets Touch,

Kannan

June 9, 2009 7:14 AM

i have one more constrain... i need to enable the same in Win32program and i can't able to use .Net stuff.

Lets Touch,

Kannan

June 9, 2009 9:34 AM

The touchsmart code i posted the link to on this site are specificaly for the IQ series touchsmart's, that is the one piece units where everything is built into the screen, and where the screen overlay is manufactured by NextWindow.

Multi touch in general is NOT available at operating system level on any system that pre-dates WIndows7, so this includes Vista.

Unless you can

A) Identify the manufacturer of the screen overlay on your particular model

and

B) Find a similar API style download from said manufacturer

then it's basically a case of no go.

If you update to windows 7 however, then you can probably use the operating system wide multi touch stuff.

As for this having to be Win32 only rather than a .NET program, then I'd say have fun trying to find this, beacuse it's getting harder and harder these days to find base Win32 level libraries for anything that's defined in the OS.

June 9, 2009 10:44 PM

Thanks for the reply.

I am working in a Wacom Touchscreen enabled PC and i need to search for the related API.

Do you know when we develop the application based on Development Guidelines would support this????

Lets Touch,

Kannan

June 9, 2009 11:34 PM

If you're talking about the Development Guidelines posted here on the site, they only apply to the IQ500/800 series desktop machines. Not to the tx2 or the tx2000. I don't know if there are any plans to publish Development Guidelines from HP for developing on the tx2000 or tx2. My guess is no at this point, but I don't work in the notebook group. So I don't know for sure.

You'll need to rely on information from NTrig for the tx2 and someone else for the tx2000 (not sure who). Once Windows 7 is officially released things may get easier, but possbily not for hardware that was produced before Win 7.

Discussion:    Add a Comment | Back to Top | Comments 1-20 of 24 | Latest Comment | 1 2 Next »

Add Your Reply

(will not be displayed)

Email me when comments are added to this thread

 
 

Please log in or register to participate in this community!

Log In

Remember

Not a member? Sign up!

Did you forget your password?

You can also log in using OpenID.

close this window
close this window