Solved

How do I get my vb.net application to record touch screen events from Windows Mobile when it's not in focus?

Posted on 2008-10-02
3
1,078 Views
Last Modified: 2013-12-21
I have a small program in Windows Mobile using VB.net that has a form (Form1) and and 2 list boxes (Listbox1, Listbox2). What I want to do is simply capture the X and Y coordinates of the stylus on touch screen events, and then put the X and Y coordinate values in their respective list boxes. Can this be done?

If at all possible I would like to find any examples, tutorials etc that show how to do this when the application is 1) in focus; and 2) not in focus. At minimum I would like to know how this is done while my form is in focus....but my main objective is to do this when my program is not in focus.

Thanks....
0
Comment
Question by:jazjef
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 22623312
handle  MouseDown event which is fired with MouseEventArgs - these have X,Y coordinates where the stylus is tapped on the screen
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 22623317
oops, misread your question, so above is true when the window is in focus
0
 
LVL 4

Accepted Solution

by:
jazjef earned 0 total points
ID: 22626399
alexey:
Here is some code I found that runs error-free...but the code doesn't return anything yet...  how can I tap into it to get the x y values out... will this work for me? Where do I put my statement to return the coordinates? Thanks....


 _
Private Shared Sub mouse_event(dwFlags As MOUSEEVENTF, dx As Integer, dy As Integer, dwData As Integer, dwExtraInfo As Integer)
End Sub

 _
Private Enum MOUSEEVENTF
    MOVE = &H1
    ' mouse move
    LEFTDOWN = &H2
    ' left button down
    LEFTUP = &H4
    'left button up
    RIGHTDOWN = &H8
    'right button down
    RIGHTUP = &H10
    'right button up
    MIDDLEDOWN = &H20
    'middle button down
    MIDDLEUP = &H40
    ' middle button up
    WHEEL = &H800
    'wheel button rolled
    VIRTUALDESK = &H4000
    ' map to entrire virtual desktop
    ABSOLUTE = &H8000
    ' absolute move
    TOUCH = &H100000
    ' absolute move
End Enum


Friend Shared Sub SendTap(x As Integer, y As Integer)
    mouse_event(MOUSEEVENTF.LEFTDOWN Or MOUSEEVENTF.ABSOLUTE, CInt(((65535 / Screen.PrimaryScreen.Bounds.Width) * x)), CInt(((65535 / Screen.PrimaryScreen.Bounds.Height) * y)), 0, 0)
    mouse_event(MOUSEEVENTF.LEFTUP, 0, 0, 0, 0)
End Sub
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 and application notifications 4 44
Can't Login to Laptop 18 46
SSL how to convert PK7C standard godaddy to PFX 17 45
Unabled to open web site 10 35
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question