Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 911081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:08:39+00:00 2026-05-15T17:08:39+00:00

i need to implement a cursor with some very specific features: it has to

  • 0

i need to implement a cursor with some very specific features:

  • it has to be animated
    • because after n seconds it automatically clicks – so the animation is feedback for the user when the click will happen
  • it has to snap to some of our controls
  • it has to work outside of our application

the approaches so far:

  • render my WPF-control into a bitmap, make a cursor-struct out of it and use user32.dll/SetSystemCursor to set it
    • PRO
    • the cursor has no delay after the mouse since it’s a real cursor
    • CON
    • snapping is quite hard, especially since we have absolute and relative inputdevices and i would have to reset the mouseposition all the time or use user32.dll/ClipCursor (System.Windows.Forms.Cursor.Clip does the same) but the snapped cursor is always shaking around the snapped position (tries to escape, get’s reset again….)
    • the code i use throws strange exceptions after some random time – so my current code seems quite unstable
  • render my own cursor into a maximized, topmost, allowtransparent, windowstyle=none, invisible window and manually move the cursor after the mouse (like Canvas.SetLeft(cursor, MousePosition.X))
    • PRO
    • snapping can be (easily) done
    • CON
    • when the mouse clicks and hit’s the cursor the cursor get’s clicked and not the window beyond
    • polling the mouseposition in a dispatcher-background-loop all the time doesn’t seem very beautiful to me

to solve the second approach my cursor would have to have at least one transparent pixel
in the hotspot, so that the mouse can click through… that doesn’t seem like a real solution to me…

any idea’s anyone?

EDIT:
some example-source to show the problems…:

example app & source to show the problem with snapping the mouse to a fixed position: ClipIt.rar

example app & source that fails after random time – setting a self-drawn cursor: TryOwnCur.rar

can be found under: http://sourcemonk.com/Cursor

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:08:40+00:00Added an answer on May 15, 2026 at 5:08 pm

    thanks to http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a3cb7db6-5014-430f-a5c2-c9746b077d4f

    i can click through my self-drawn cursor which follows the mouse-position by
    setting the window style:none, and allowtransparent as i already did and
    then

    public const int WS_EX_TRANSPARENT = 0x00000020;
      public const int GWL_EXSTYLE = (-20);
    
      [DllImport("user32.dll")]
      public static extern int GetWindowLong(IntPtr hwnd,
      int index);
    
      [DllImport("user32.dll")]
      public static extern int SetWindowLong(IntPtr hwnd,
      int index, int newStyle);
    
      public static void makeTransparent(IntPtr hwnd) {
         int extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
         SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
      }
    

    and call makeTransparent from OnSourceInitialized…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think, you have to use an anchor, which are… May 15, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer So for some reason the Server did not recognized the… May 15, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer Alright, got this working, you got to have root access… May 15, 2026 at 10:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.