CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Create a cursor from DC?

  1. #1
    Join Date
    Sep 2006
    Posts
    199

    Create a cursor from DC?

    I have an ActiveX control that displays a line of text. I want to change the cursor to show the text itself when the user drags the control (to drop it somewhere else).

    How can I create a cursor from the text drawn on/by the control?

  2. #2
    Join Date
    Aug 2001
    Location
    Sydney, Australia
    Posts
    813

    Re: Create a cursor from DC?

    So the text will be different each time?

    This might get a bit tricky...
    Microsoft LVP - Least Valuable Professional

    Please rate this post... Pleeeeeeaaassee!!!

  3. #3
    Join Date
    Sep 2006
    Posts
    199

    Yes...

    I want to use the text that is drawn to create a cursor, so that the user sees the actual text move across the page as it is dragged.

  4. #4
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Yes...

    Just handle the mouse move message, erase the text in the old location, and draw the text int he new location. IIRC, cursors can't be bigger then a set size (I want to say 16x16 pixels, but I'm not sure that's right).

    Viggy

  5. #5
    Join Date
    Aug 2001
    Location
    Sydney, Australia
    Posts
    813

    Re: Yes...

    Quote Originally Posted by MrViggy
    Just handle the mouse move message, erase the text in the old location, and draw the text int he new location. IIRC, cursors can't be bigger then a set size (I want to say 16x16 pixels, but I'm not sure that's right).

    Viggy
    Yeah but even if he can get the text string (which he should be able to) how do you create a cursor resource with the text in it as an image in the cursor, at runtime?

    I'd be interested to know. I'll add a subscription to this thread.
    Microsoft LVP - Least Valuable Professional

    Please rate this post... Pleeeeeeaaassee!!!

  6. #6
    Join Date
    Sep 2006
    Posts
    199

    Re: Create a cursor from DC?

    My intent is to leave the existing text as displayed, so the user knows where it "was", as well as WHAT it was as he/she is dragging it somewhere else.

    Re: the size of a cursor, maybe a cursor per se isn't the right way to think of this... is there a way to just move a block of pixels (transparent except the text) around with the mouse? At the same time change the cursor to a pre-defined dot-sized transparent one so you wouldn't see it on top of the moving text.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)