programming4us
programming4us
DESKTOP

Windows 7 : Working with the Multi-Touch User Interface (part 2) - Obtaining the Multi-Touch Platform Interop Library, Configuring the Application

12/26/2013 1:42:43 AM

3. ADDING MULTI-TOUCH TO YOUR APPLICATION

Microsoft provides a number of interesting example programs, all of them complicated and all of them graphics-oriented. The examples are obviously designed to show off the capabilities of the Multi-Touch Interface, and they do a very good job of that. However, most organizations don't really need complex graphics applications — they need a version of Multi-Touch that works with push buttons and the like. The Multi-Touch example is very simple. It demonstrates how you add the Multi-Touch Interface to a business application so that the user can interact with it using the keyboard, mouse, or the Multi-Touch Interface as desired. The example is purposely kept simple so that you can modify the code as needed for your application.

3.1. Obtaining the Multi-Touch Platform Interop Library

As with most things Windows 7, Visual Studio doesn't provide the support required to access the features. In this case, the Code Pack won't help you either. Instead, download the Windows 7 Multitouch .NET Interop Sample Library from http://code.msdn.microsoft.com/WindowsTouch. When you open the Win7RC_MT.ZIP file to your root directory, you'll end up with a \Win7RC_MT folder that contains the source code you need to create the interoperability (interop) library. These steps will help you create the interop library used for the example in this chapter.

  1. Open the Windows7.SLN solution using Visual Studio. Because this is an older solution, you'll need to convert it for use with Visual Studio 2010. Simply follow the Visual Studio Conversion Wizard prompts as usual.

  2. Choose Build => Build Solution. The build is going to fail with five errors.

  3. Locate the error RC1004: unexpected end of file found error for Resource.H. Double-click this entry. Visual Studio will open the Resource.H file for you.

  4. Go to the end of the Resource.H file and press Enter to add a linefeed. Save the file and close it.

  5. Locate the \Win7RC_MT\Demo\Multitouch\MutlitouchWPF\mtWPFInertia\Images folder on your system.

  6. Copy to the folder four JPG images named Pic1.JPG, Pic2.JPG, Pic3.JPG, and Pic4.JPG. The content of the images doesn't really matter, as long as you provide JPG files.

  7. Choose Build => Build Solution. The build should succeed this time.

After you're able to build the library, you'll find the Windows7.Multitouch.DLL library in the \Win7RC_MT\Release folder. This is the library you use to gain access to the Multi-Touch Platform when working with a Windows Forms application. If you want to create a Windows Presentation Foundation (WPF) application instead, you need the Windows7.Multitouch.WPF.DLL library found in the \Win7RC_MT\Mutitouch\Windows7.Multitouch.WPF\bin\Release folder.

3. 2. Configuring the Application

The Multi-Touch example begins with a Windows Forms application. The application has two push buttons, Test and Quit, that the user will be able to interact with, using keyboard, mouse, or touch (assuming the user's system has a touch device). You need to add the following reference using the Browse tab of the Add Reference dialog box. (The Multi-Touch interop library appears in the \Win7RC_MT\Release folder, as shown in Figure 1.)

Windows7.Multitouch.DLL

Figure 1. Add the required reference DLL to your project.

If you decided to create a debug version of the library, then you'll need to look in the \Win7RC_MT\Debug folder instead. You'll also need to add several using statements for this example, as follows:

using Windows7.Multitouch;
using Windows7.Multitouch.Win32Helper;
Other  
  •  Windows Server 2003 : Configuring Zone Properties and Transfers (part 4)
  •  Windows Server 2003 : Configuring Zone Properties and Transfers (part 3)
  •  Windows Server 2003 : Configuring Zone Properties and Transfers (part 2)
  •  Windows Server 2003 : Configuring Zone Properties and Transfers (part 1)
  •  Windows 7 : Managing Pictures with Windows Live Photo Gallery (part 14) - Sharing with E-mail, Sharing on the Web: Services Integration
  •  Windows 7 : Managing Pictures with Windows Live Photo Gallery (part 13) - Printing Pictures and Ordering Prints, Adding Photos to Movies, DVDs, and Data Discs
  •  Windows 7 : Managing Pictures with Windows Live Photo Gallery (part 12) - Using Photos as Slide Shows
  •  Windows 7 : Managing Pictures with Windows Live Photo Gallery (part 11) - Enjoying Photos on Your Own PC
  •  Windows 7 : Managing Pictures with Windows Live Photo Gallery (part 10) - Resizing Photos,Creating Panoramic Photos , Editing with Other Applications
  •  Windows 7 : Managing Pictures with Windows Live Photo Gallery (part 9) - Editing Pictures
  •  
    Video
    PS4 game trailer XBox One game trailer
    WiiU game trailer 3ds game trailer
    Top 10 Video Game
    -   Minecraft Mods - MAD PACK #10 'NETHER DOOM!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
    -   Minecraft Mods - MAD PACK #9 'KING SLIME!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
    -   Minecraft Mods - MAD PACK #2 'LAVA LOBBERS!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
    -   Minecraft Mods - MAD PACK #3 'OBSIDIAN LONGSWORD!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
    -   Total War: Warhammer [PC] Demigryph Trailer
    -   Minecraft | MINIONS MOVIE MOD! (Despicable Me, Minions Movie)
    -   Minecraft | Crazy Craft 3.0 - Ep 3! "TITANS ATTACK"
    -   Minecraft | Crazy Craft 3.0 - Ep 2! "THIEVING FROM THE CRAZIES"
    -   Minecraft | MORPH HIDE AND SEEK - Minions Despicable Me Mod
    -   Minecraft | Dream Craft - Star Wars Modded Survival Ep 92 "IS JOE DEAD?!"
    -   Minecraft | Dream Craft - Star Wars Modded Survival Ep 93 "JEDI STRIKE BACK"
    -   Minecraft | Dream Craft - Star Wars Modded Survival Ep 94 "TATOOINE PLANET DESTRUCTION"
    -   Minecraft | Dream Craft - Star Wars Modded Survival Ep 95 "TATOOINE CAPTIVES"
    -   Hitman [PS4/XOne/PC] Alpha Gameplay Trailer
    -   Satellite Reign [PC] Release Date Trailer
    Game of War | Kate Upton Commercial
    programming4us
     
     
    programming4us