Announcement

Collapse
No announcement yet.

Cursor becomes visible after shell?

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

  • Cursor becomes visible after shell?

    The cursor becomes visible after

    SHELL "Net time \\MAIN /SET /YES >Z:\SHELLOUT.LOG"

    I added the following

    Locate ,,1
    Locate ,,0

    Seems to work some times.

    Any ideas?

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

  • #2
    The "problem" is that on most Windows platforms, NET.EXE is not a DOS application, but is a Windows console app, and it is leaving a phantom cursor on the screen.

    In my tests (Win2K) the problem only showed up when the DOS app was not running full-screen.

    The solution? Well, this is by trial and error, and YMMV:

    It seems that when SHELL returns, NET.EXE is still running (it's probably a multi-threaded app) and is reenabling the cursor some time <U>after</U> your LOCATE statement switches it off.

    Therefore, a possible solution is to wait for say, 0.5 seconds or so before setting the cursor state back to 0. Additionally, the 'key' seems to be to enable the cursor before the SHELL operation!
    Code:
    locate ,,100
    print "About to go..."
    shell "Net.exe time \\main > nul"
    sleep .5
    locate ,,0
    print "done!"
    Since NET.EXE may send output to STDERR that cannot be easily blocked out, you may wish to save the screen buffer and refresh it after the SHELL in order to remove any "stray" output that may detract from the appearance of your app.
    Code:
    ...
    DEF SEG = pbvScrnBuff \ &H10000
    A$ = PEEK$(0,4000)
    DEF SEG
    SHELL "...
    DEF SEG = pbvScrnBuff \ &H10000
    POKE$ 0, A$
    DEF SEG
    ...
    I hope this helps!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Wow ! What a lot of hassle just to kill the Cursor

      After return from the SHELL, try:

      DELAY 5 ''''''''''' more or less
      SCREEN ,,0,0
      COLOR 0,3,3: CLS ''''''''''' or whatever Background colour
      (COLOR 0,0 displays nothing until you want to again)
      LOCATE ,,0,0,0

      I do not use WIN services in my apps and can't test it myself.
      I wish I could know half of what Lance does about PB-DOS in Windows

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




      [This message has been edited by OTTO WIPFEL (edited March 14, 2002).]

      Comment

      Working...
      X