I found these answers to how to create an auto-logout in a WinForms app. In this part of the answer, what should I use for monitor messages from a touchscreen (or do the also work)?
public bool PreFilterMessage(ref Message m) {
// Monitor message for keyboard and mouse messages
bool active = m.Msg == 0x100 || m.Msg == 0x101; // WM_KEYDOWN/UP
active = active || m.Msg == 0xA0 || m.Msg == 0x200; // WM_(NC)MOUSEMOVE
active = active || m.Msg == 0x10; // WM_CLOSE, in case dialog closes
if (active) {
if (!mTimer.Enabled) label1.Text = "Wakeup";
mTimer.Enabled = false;
mTimer.Start();
}
return false;
}