Announcement

Collapse
No announcement yet.

Hide Cursor On App Startup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hide Cursor On App Startup

    Hello,

    I am running Win98SE. During the creation of my windows class for a presentation program I call this:
    wndclass.hCursor = %NULL

    And on %WM_CREATE and %WM_MOUSEMOVE I call this:
    CALL SetCursor(%NULL)
    FUNCTION = 0: EXIT FUNCTION

    If I open the program from explorer using by double clicking on the EXE with the mouse, and don't move the mouse at all, the cursor remains on the screen.

    If I open the program using a shortcut (as in the start menu) or if I open it from Explorer by using the Enter key, the cursor is removed properly.

    Call me picky, but I'd like this cleaned up (if possible.) Has any one come across this before or am I messing it up? I have seen this happen to screen savers (that I didn't write) in both Win95 and Win98.

    I searched the forum for old messages, but nothing came up.

    Thanks,
    Colin Schmidt

    -------------
    Colin Schmidt & James Duffy, Praxis Enterprises, Canada

  • #2
    If you don't come up with a solution, you can try this...

    Make a custom cursor that is totally transparent for that class.
    The cursor will be still be there, but invisible.

    Just a thought.
    Regards, Jules
    Best regards
    Jules
    www.rpmarchildon.com

    Comment


    • #3
      Try:

      Code:
       wndClass.hCursor = LoadCursor(%Null, %IDC_ICON)
      For a blank one, as Jules suggested.


      ------------------
      Kev G Peel
      KGP Software
      Bridgwater, UK.
      mailto:[email protected][email protected]</A>

      Comment


      • #4
        Hello,

        LoadCursor(%Null, BYVAL %IDC_ICON) didn't work either. Thanks for the suggestion though.

        I guess the best solution is to use a completely transparent cursor as Jules Marchildon suggested. Then I would not need to worry about it working in all situations.

        Thanks guys,
        Colin Schmidt

        ------------------
        Colin Schmidt & James Duffy, Praxis Enterprises, Canada

        Comment


        • #5
          I used the following in a character map I did once and it worked
          fine for me. It's a matter of setting the counter for ShowCursor
          to the right value - maybe it can help you out here:

          Code:
          SUB HideCurs
            LOCAL ret AS LONG
            ret = 0
           
            DO WHILE ret > -1
              ret = ShowCursor(0)
            LOOP
          END SUB
           
          SUB ShowCurs
            LOCAL ret AS LONG
            ret = -1
           
            DO WHILE ret < 0
              ret = ShowCursor(-1)
            LOOP
          END SUB
          ------------------

          Comment


          • #6
            Colin, one thing to consider for my solution, is the fact the
            user can still go click-crazy with the mouse, so you still get
            the mouse messages, if you don't want them your going to have
            to eat his cheese.

            Regards, Jules

            ------------------
            Best regards
            Jules
            www.rpmarchildon.com

            Comment

            Working...
            X