Hi to everybody.
I've just started a new project for my company in a touch-screen environment.
I started to implement a form that simulates a keyboard without taking the focus in order to write i.e. in notepad.
It's possible by overriding the WndProc(ref Message m) and refusing the activation on mouse click and starting the form in "no-activation" mode, showing it by mean of User32.dll API ShowWindow(MyForm.handle, 0x0010). It's also necessary not to use any control that is Focusable (i.e. instead of buttons I've used PictureBoxes).
The code (...I've found on Internet...) of WndProc is:

private const int WM_MOUSEACTIVATE = 0x0021;
private const int MA_NOACTIVATE = 0x0003;


protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOUSEACTIVATE)
{
m.Result = (IntPtr)MA_NOACTIVATE;
}
else
base.WndProc(ref m);
}

But now I've this problem: how to click in MyForm (with my finger...) without moving the cursor
from his current position (maybe on another form...).

Stefano

I "solved" the problem by managing the touchscreen in a proprietary matter.
One of my colleague provided me a DLL that captures the message directly from the USB driver of my touchscreen and translates these messages calling one of my callback.
I suppose there's no way of doing in a different way :(

Clicking a form without moving the mousepointer goes against all the purpose of the GUI as the mousepointer would have to move to do it, while 1 app can tell another that the mouse has been fake clicked on say a button, the app doing that would need to know to do it and when.

Can u please suggest me some tutorials or samples to create all new touch screen application.

Can you suggest what dll you used it to make it working

can you please suggest what dll you used to make it working?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.