1

Windows 10 has this feature wherein the user can press the CTRL key and it will ping the cursor location :

enter image description here

Is there a way to invoke this effect in C# ( WPF/XAML )? If so, how?

Will
  • 3,413
  • 7
  • 50
  • 107
  • Win forms? Web application? WPF? Need more info to help you better. http://stackoverflow.com/questions/28763896/how-to-highlight-the-mouse-pointer-position-using-c-sharp – sab669 Dec 02 '16 at 20:51
  • @sab669 WPF/XAML. Sorry; my bad. – Will Dec 02 '16 at 20:56
  • The easiest way will be to get a reference to the system.windows.forms and get your mouse coordinates from there. Somethige along side this: Point mouseCordinates = Control.MousePosition; If that is what you asked for – Proxy Dec 02 '16 at 21:22
  • @Proxy Nope, sorry. I don't care where the cursor is. I need a way to indicate to the user where it is. A text box with an X/Y coordinate position would be useless to them. – Will Dec 02 '16 at 21:26
  • Here is a link to a stackoverflow using interrupts. https://stackoverflow.com/questions/1316681/getting-mouse-position-in-c-sharp – CSR Dec 02 '16 at 21:34
  • @Cstr No. That is not what I am looking for. Please see the image in the question. I need to indicate to the user graphically where the cursor is. – Will Dec 02 '16 at 21:35
  • 1
    A full answer would be too long for this site's medium, so instead I'll just describe one possible process: create a borderless transparent window that ignores focus and stretch it across the full screen(s). Then hook keyboard events and listen to whenever `Ctrl` is pressed. Then get the position of the cursor and create a ping graphic using either a storyboard or by overriding the paint method of the window. – Abion47 Dec 02 '16 at 21:49
  • @Abion47 : If you look at the form, it indicates that this is a built-in function of Windows 10 ( I believe it was also in 7 and 8 ). My question is not about how to duplicate this effect in some alternate way. I'm not looking to re-invent the wheel here. What I am looking for is how to use the wheel that already exists within Windows 10 ( if the wheel is for sale; if it's not, I'm looking for someone to tell me "Nope, sorry. Only the OS can use that function/class/dll/library/method/etc." ). – Will Dec 04 '16 at 06:15
  • @Will I have no idea what DLL holds that function or even where to start looking for it. Perhaps in this instance reinventing the wheel would be easier and faster than hunting down existing tools. – Abion47 Dec 04 '16 at 16:50

0 Answers0