Announcement

Collapse
No announcement yet.

Disappearing Mouse Pointer

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

  • Disappearing Mouse Pointer

    I chased this one for quite awhile this am.
    The mouse pointer dissapears on my Win2k system when entering text in a single line edit box.
    No problems on Win98SE.

    Any Ideas???

    Here is the source I used.

    James

    Code:
    '=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
    '                     PBWinAdp RC2DDT Conversion
    '=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
    '   RC File: C:\NOPOINT\DLG_100.RC
    '  DDT File: C:\NOPOINT\DLG_100.DDT
    '      Date: 08-12-2001
    '      Time: 10:13:37
    '=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
    #COMPILE EXE
    #DIM ALL
    #REGISTER NONE
    #INCLUDE "WIN32API.INC"
    '=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    %DLG_100_EDIT1 = 103
    %DLG_100_PB_OK = 101
    %DLG_100_PB_CANCEL = 102
    '===========================================================================
    CALLBACK FUNCTION _ 
      DLG_100_CB AS LONG
    
      SELECT CASE CBMSG
        CASE %WM_INITDIALOG
          SendMessage CBHNDL,%WM_SETICON,1,LoadIcon(0,BYVAL %IDI_APPLICATION)
      END SELECT
    END FUNCTION
    '===========================================================================
    FUNCTION _ 
      Create_DLG_100 ( _
        BYVAL hParent		AS LONG _
      ) AS LONG
    
      DIM hDlg                              AS LONG
      DIM lRetVal                           AS LONG
    '---------------------------------------------------------------------------
      DIALOG NEW hParent, _
                "Mouse Pointer Disappears", _
                0, _
                0, _
                240, _
                120, _
                %DS_MODALFRAME OR %DS_3DLOOK OR %WS_OVERLAPPED OR %WS_VISIBLE OR %WS_CAPTION OR %WS_SYSMENU, _
                %WS_EX_DLGMODALFRAME, TO hDlg
    
    '---------------------------------------------------------------------------
      CONTROL ADD BUTTON, _
                  hDlg, _ 
                  %DLG_100_PB_OK, _
                  "OK", _
                  186, _
                  6, _
                  50, _
                  14, _
                  %BS_PUSHBUTTON OR %BS_CENTER OR %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP, _
                  , 'CALL DLG_100_PB_OK_CB
    '---------------------------------------------------------------------------
      CONTROL ADD BUTTON, _
                  hDlg, _ 
                  %DLG_100_PB_CANCEL, _
                  "Cancel", _
                  186, _
                  26, _
                  50, _
                  14, _
                  %BS_PUSHBUTTON OR %BS_CENTER OR %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP, _
                  , 'CALL DLG_100_PB_CANCEL_CB
    '---------------------------------------------------------------------------
      CONTROL ADD TEXTBOX, _
                  hDlg, _ 
                  %DLG_100_EDIT1, _
                  "Edit1", _
                  12, _
                  17, _
                  76, _
                  13, _
                  %ES_LEFT OR %WS_CHILD OR %WS_VISIBLE OR %WS_BORDER OR %WS_TABSTOP, _
                  %WS_EX_CLIENTEDGE, 'CALL DLG_100_EDIT1_CB
      DIALOG SHOW MODAL hDlg,CALL DLG_100_CB TO lRetVal
      FUNCTION = lRetVal
    END FUNCTION
    '===========================================================================
    FUNCTION _
      PBMain ( _
      ) AS LONG
    
      Create_DLG_100 0
    
    END FUNCTION

    ------------------

  • #2
    I think this is an actual "feature" of Windows 2000. In the Mouse pcl in
    Control Panel there is an option called 'Vanish' that hides your mouse cursor
    while you type.

    - Nathan

    Comment


    • #3
      Nathan,
      I don't see it.
      All I see is Enable pointer shadow.

      James


      ------------------

      Comment


      • #4
        James --
        I see both - caret and cursor.
        If you don't like standart cursor, SetClassLong GetDlgItem(hDlg, ...), %GCL_HCURSOR, ...

        ------------------
        E-MAIL: [email protected]

        Comment


        • #5
          Semen,
          The standard pointer is not the issue.
          I thought I had problems with my code in an interpreter I'm working on
          because the mouse pointer disappeared whenever I started entering text in an
          edit field. It did not reappear until the mouse was moved or the alt key was pressed.
          I finally tried the code on Win98 and it worked fine ( pointer did not disappear).

          James


          ------------------


          [This message has been edited by jcfuller (edited August 12, 2001).]

          Comment


          • #6
            James --
            I don't see and never saw any troubles on my PC (Win2000 Pro + SP2)
            Code:
               #Compile Exe
               #Dim All
               #Register None
               #Include "WIN32API.INC"
               
               %ID_TEXTBOX = 101
            
               Function PbMain
                  Dim hDlg As Long
                  Dialog New 0, "Any problems ?", , , 160, 45, %WS_OVERLAPPEDWINDOW To hDlg
                  Control Add TextBox, hDlg, %ID_TEXTBOX, "", 10, 10, 80, 12
                  SetClassLong GetDlgItem(hDlg, %ID_TEXTBOX), %GCL_HCURSOR, LoadCursor(ByVal 0, ByVal %IDC_ARROW)
                  Control Add Button, hDlg, %IDOK, "Ok", 100, 5, 50, 14
                  Control Add Button, hDlg, %IDCANCEL, "Cancel", 100, 26, 50, 14
                  Dialog Show Modal hDlg
               End Function
            ------------------
            E-MAIL: [email protected]

            Comment


            • #7
              Semen,
              Same problem using your source. If the pointer is within the boundries of the
              Dialog the pointer vanishes when you start entering text.

              I have not applied SP2 yet.

              James


              ------------------


              [This message has been edited by jcfuller (edited August 12, 2001).]

              Comment


              • #8
                Hmm ... Cusrsor temporary disappears, when you type symbols, and then appears again - yes.
                Or it doesn't appear again on your PC at all ?

                ------------------
                E-MAIL: [email protected]

                Comment


                • #9
                  Semen,
                  The pointer appears again only if you move the mouse or press the Alt key.

                  James




                  ------------------

                  Comment


                  • #10
                    James --
                    On my PC it appears again "automatic" and I don't remember another behaviour (I use Win2000 much more than one year and re-installed it many times).
                    Maybe time to think about Russian release ?

                    If seriously, it's obviously not Win2000 problem as it is.
                    If you have normal distributive (I mean non-upgrade/OEM variant), try to reinstall from "zero base" w/o installing external drivers.



                    ------------------
                    E-MAIL: [email protected]

                    Comment


                    • #11
                      Semen,
                      I just installed SP2. No change.
                      I was concerned that it was my program that caused it (when I first noticed it).
                      Now that I know that it's my system I can live with it, no big deal, but I am
                      still courious why??
                      I have Win2k installed on 2 systems and they both exhibit the same characteristics.
                      I do have W95DOSHERE (from prowertoys) installed on both systems??


                      James


                      ------------------




                      [This message has been edited by jcfuller (edited August 12, 2001).]

                      Comment


                      • #12
                        Maybe it is a DDT dialog "feature"? Similar thing happens when one sets
                        MOUSEPTR 11 and THEN try to restore with MOUSEPTR 0. Must move mouse to
                        activate. Simple fix is to restore to MOUSEPTR 1. In this case it may
                        help to trap %EN_CHANGE notification under %WM_COMMAND and reset the
                        mouse pointer manually? Untested, but in dialog's callback:
                        Code:
                        CALLBACK FUNCTION DlgProc() AS LONG
                          SELECT CASE CBMSG
                             CASE %WM_COMMAND
                                IF CBCTLMSG = %EN_CHANGE THEN MOUSEPTR 3 (or 1, whatever..)
                          END SELECT
                        END FUNCTION

                        ------------------

                        Comment


                        • #13
                          I just move the mouse to make sure it shows up as expected:

                          Code:
                          FUNCTION MoveCursor ALIAS "MoveCursor" () EXPORT AS LONG
                          LOCAL pnt AS pointapi
                           
                            GetCursorPos pnt
                            IF pnt.x > 0 THEN
                              SetCursorPos pnt.x - 1, pnt.y
                            ELSE
                              SetCursorPos pnt.x + 1, pnt.y
                            END IF
                            SetCursorPos pnt.x, pnt.y
                          END FUNCTION
                          Peter


                          ------------------
                          [email protected]
                          [email protected]

                          Comment


                          • #14
                            Borje,
                            It's not just DDT. The original code where I first noticed it was straight SDK.

                            James


                            ------------------

                            Comment


                            • #15
                              Peter,
                              A bit too much work.
                              To move the mouse(generate a WM_MOUSEMOVE) use the followng:

                              GetCursorPos tpt
                              SetCursorPos tpt.x, tpt.y


                              ------------------
                              Dominic Mitchell
                              Dominic Mitchell
                              Phoenix Visual Designer
                              http://www.phnxthunder.com

                              Comment

                              Working...
                              X