问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/1511682/detect-stylusdown-outside-app-window