Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8435367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:53:44+00:00 2026-06-10T06:53:44+00:00

Before you mark this as a duplicate of this post, know that I am

  • 0

Before you mark this as a duplicate of this post, know that I am asking for more clarity and specificity than the answer to that question provides.

Specifically, I want to know how to, in C#, build a WM_TOUCH message and send it out.

The documentation on it (linked above) tells what it’s composed of and how to gather the information it sends, but it says nothing about how to actually build a WM_TOUCH message, and I don’t know enough about C# to work with what I’ve been able to find.

I know that it should look something like this:

[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int wMSg, IntPtr wParam, IntPtr lParam);

/* code to make wParam and lParam */

SendMessage(HWND_BROADCAST, WM_TOUCH, _wParam, _lParam);

The wParam is going to be an int that tells how many multi-touch points found within the lParam. The lParam itself “Contains a touch input handle that can be used in a call to GetTouchInputInfo to retrieve detailed information about the touch points associated with this message” according to the msdn page. The GetTouchInputInfo function returns TOUCHINPUT structs.

My question is how to build the TOUCHINPUT structs in C# (since the documentation is in C++) and also how to pass that information through the SendMessage() function so that I can treat the kinect as a general multi-touch device in any multi-touch application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:53:45+00:00Added an answer on June 10, 2026 at 6:53 am

    You will need to represent the C++ structure in C# code.
    Once you have a C# struct, you can use it as an input or output parameter.
    The best way I have found of converting these structures is to use the P/Invoke Interop Assistant at : http://clrinterop.codeplex.com/releases/view/14120

    Copying the TOUCHINPUT structure from the link you posted gives this output :

    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
    public struct TOUCHINPUT {
        /// LONG->int
        public int x;
        /// LONG->int
        public int y;
        /// HANDLE->void*
        public System.IntPtr hSource;
        /// DWORD->unsigned int
        public uint dwID;
        /// DWORD->unsigned int
        public uint dwFlags;
        /// DWORD->unsigned int
        public uint dwMask;
        /// DWORD->unsigned int
        public uint dwTime;
        /// ULONG_PTR->unsigned int
        public uint dwExtraInfo;
        /// DWORD->unsigned int
        public uint cxContact;
        /// DWORD->unsigned int
        public uint cyContact;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

before I start I want to point out that I tagged this question as
Before asking the question let me preface with the fact that I am new
Before you mark this as answered in another post (I already saw those). But
Please read this entire question before you try to mark this as too controversial.
Before I start I must say that I maybe biting more than I can
Okay..so before you mark this is as a repeated question, read it. I've implemented
(Pre-emptive strike: If you're tempted to mark this as a duplicate, note that other
Possible Duplicate: What does the exclamation mark do before the function? What's the point
Before asking my question, let me explain the context. CONTEXT: I have a web
Before starting, I'm not asking about standard coding practice or etiquette. My question is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.