tags:

views:

56

answers:

1

Simple question, hope the answer won't be: "You cant" :-)

How (in code) can I subscribe to a "global" stylus down event. Windows 7 obviously does it in some way, as the little tablet icon appears as soon as I use the stylus (wacomm pen and touch, but this seems irrelevant).

I want to create a simple drawing app which runs silently in the background (perhaps a small taskbar icon) and pops up as soon as I pick up the stylus and start drawing..

I am able to do all these things with a window, but the StylusDown is an attached UI property. Is there some global property?

A semi transparent window overlaying all of my desktop all the time is not "really" an alternative..

Chris

A: 

Short :

You can't. :-)

Long:

You way use p/invoke to call the windows API function GetCursorPos.

[DllImport("user32.dll")]
public static extern bool GetCursorPos(out Point pt);

You may want to call this function periodically with a timer to be up to date.

codymanix
Ok, but if I read the return values correctly, this only gives me a point. How do I deduct that this is a stylus position. Any way to access the "device information" like when using the ink canvas (makes it possible to distinguish mouse and stylus)
Christian