CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2002
    Posts
    2

    Full Screen X-hair Cursor

    I am working on a dual monitor system with the left monitor diplaying a window with several child windows. I need to implement a full screen cross hair cursor for this display, reverting to the normal windows cursor for the right hand display. It is important that mouse messages are processed normally when the cursor x-intersection is on each child window. Anyone any ideas how this might be achieved?
    Thank-you


  2. #2
    Join Date
    Jun 1999
    Posts
    1,786

    Re: Full Screen X-hair Cursor

    You want hair cursor which will be visible only inside of the client area of current child window, right?
    How to do it:
    1. You must hide original Windows cursor. You overwrite OnSetCursor of your view and set cursot to NULL.
    2. You must be able to draw cursor manually. You must redraw cursor on in new position in OnSetCursor



    Good luck
    Please rate if you think this response was useful for you
    Have more questions? Feel free to ask.

  3. #3
    Join Date
    Mar 2001
    Location
    Colorado
    Posts
    241

    Re: Full Screen X-hair Cursor

    If anyone has sample code for doing this, I would really appreciate it. I have to do the same thing.

    Thanks in advance,

    Wade

  4. #4
    Join Date
    Jun 1999
    Posts
    1,786

    Re: Full Screen X-hair Cursor

    What exactly do you want?

    Good luck
    Please rate if you think this response was useful for you
    Have more questions? Feel free to ask.

  5. #5
    Join Date
    Mar 2001
    Location
    Colorado
    Posts
    241

    Re: Full Screen X-hair Cursor

    I need to make a full screen cross-hair cursor, and the cross of the cross-hair needs to follow be the hotspot of the cursor. I hope that makes sense. Any help, or sample code for doing this would be great.

    Thanks in advance,

    Wade

  6. #6
    Join Date
    Jun 1999
    Posts
    1,786

    Re: Full Screen X-hair Cursor

    When you say 'full screen' you don't really mean 'full screen', do you? You don't mean that cursor must be drawn on window's non-client area (like toobars, caption, scroll bars etc) and outside of the window? You want cross-hair cursor to be drawn only in a window's client area, is it correct?

    Good luck
    Please rate if you think this response was useful for you
    Have more questions? Feel free to ask.

  7. #7
    Join Date
    Mar 2001
    Location
    Colorado
    Posts
    241

    Re: Full Screen X-hair Cursor

    >>You want cross-hair cursor to be drawn only in a window's client area, is it correct? <<

    Sorry, yes you are correct. A co-worker busted me for saying the same thing to him. Sorry for the misunderstanding, I only want the cross-hair in the window's client-area.

    Thanks,



    Wade

  8. #8
    Join Date
    Jun 1999
    Posts
    1,786

    Re: Full Screen X-hair Cursor

    It's relatevely easy to do. Are you sure there are no samples on CodeGuru? Try to find the sampel on CodeGuru, if you are sure there are no such a sample, I will make one for you

    Good luck
    Please rate if you think this response was useful for you
    Have more questions? Feel free to ask.

  9. #9
    Join Date
    Mar 2001
    Location
    Colorado
    Posts
    241

    Re: Full Screen X-hair Cursor

    I can't seem to find an example anywhere. I've searched MSDN, CodeProject and CodeGuru. I don't know maybe I'm not searching for the right words, but I can't find it. If you have some sample code handy, I would greatly appreciate it.

    Thanks in advance,


    Wade

  10. #10
    Join Date
    Jun 1999
    Posts
    1,786

    Re: Full Screen X-hair Cursor

    Hello
    I made a sample for you. Where do you want me to send it?

    It's a very basic sample, I overload only OnSetCursor. More complex situations will require more complex code. Anyway it's a good sample to start with. Feel free to ask if you don't understand anything in a code.



    Good luck
    Please rate if you think this response was useful for you
    Have more questions? Feel free to ask.

  11. #11
    Join Date
    Mar 2001
    Location
    Colorado
    Posts
    241

    Re: Full Screen X-hair Cursor

    Thanks a lot Serguei! I really appreciate all of your help. You can send it to WFlemmer@melco.com.


    Thanks again!

    Wade

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured