Catch Screen_MouseDown event

  • Thread starter Thread starter Daniel Moth
  • Start date Start date
D

Daniel Moth

Hi

Is there some way to detect when the user has tapped on the screen? I mean
anywhere on the screen, not by hooking into individual control events...

I am guessing there is some way to detect that the user has pressed within
the area of a form at least, again regardless of whether it was a press on a
control or directly on the form itself... I know this can be done in eVC but
any ideas how to achieve it in .NETcf please?

Cheers
Daniel

PS My real requirement is that everytime the user taps on the screen:
1. An auto_log_off timer is restarted
2. A click sound is made
3. The screen returns from half brightness to full brightness

This is on CE 4.2 by the way...
 
Well, 2 can be achieved by appropriate settings in the control panel, can't
it?

On the Control Panel, open Volume & Sounds. Screen taps controls the click
sound when the screen is tapped.

There *may* be a global event which you can WaitForSingleObject() on which
would indicate some sort of user-input event. What device are we talking
about (PPC 2003 or your own 4.2)?

Paul T.
 
We are talking about our own 4.2... The final product will not have any
Windows control panels, shell etc... All configurations thru our app...

It is the number 1 requirement that is driving the need for the
"Screen_MouseDown" event... Implementing this would give me 2 and 3 for
free... It sounds like a "MousePreview" property on the form would do it...
Working with your idea maybe we can have a named mutex from the display
driver...sounds messy...

2 and 3 alone are supported by our touchscreen driver (registry settings)
however for them to take effect the user must restart the device (for the
driver to be reloaded by device.exe)... We haven't figured out a way of
reloading a driver at runtime and keeping the app up... If there is a way,
then 2 and 3 would go away as requirements still leaving number 1 though...

Cheers
Daniel
 
A colleague demonstrated how easy this is in eVC by hooking into
PreTranslateMessage...
Maybe some trick I can do with the MessageWindow (?)

Cheers
Daniel
 
You can build an eVC DLL to capture all of the messages, if you've checked
that already, and call that DLL from your .NET CF application, sending a
message to the MessageWindow, if necessary, when a suitable event occurs. I
don't think there's any way to do this *just* with managed code.

Paul T.
 
I will explore this further...

Just to make sure I am not missing/misunderstanding something... Are you
suggesting subclassing my main form in the eVC dll? Are there any specific
examples on this (besides the one in the MSPress book or the generic ones on
the MessageWindow)?

Cheers
Daniel
 
Hi

Still no luck getting an event/message when the screen is tapped (regardless
of the active form)...

I was (naively) hoping that hooking into the WndProc of my main window
(toplevel form) would help here...

After failing with Alex Feinman's callbacks library I built an eVC dll and
had it call me back (via subclassing and the MessageWindow) whenever *any*
message was sent (after failing with WM_LBUTTONDOWN)...

This only worked when I tapped on the form area itself. I was looking for an
event even if I tapped on a child control or even on another form...

I guess what I am looking for is hooking into the main message pump of the
app not just a single form's WndProc.... Is that possible? Again, this is
posible with MFC via PreTranslate message...

Cheers
Daniel
 
Back
Top