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