Results 1 to 8 of 8

Thread: Hide/Disable Mouse Pointer?

  1. #1

    Thread Starter
    Hyperactive Member Pozzi's Avatar
    Join Date
    Feb 2001
    Location
    The Stones!
    Posts
    507

    Question Hide/Disable Mouse Pointer?

    I'm using a touch screen program and when it's launched the mouse pointer remains on the screen.

    What I'd like to do is either: -

    1) Hide the mouse pointer when the application is running

    or

    2) Make the mouse pointer so small that it's gives the impression that it's not there.

    When the application is closed I need to set the mouse pointer back to the default.

    Has any one got any ideas?

    Regards
    VB.Net (VS 2010)

  2. #2
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    VB Code:
    1. Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Long) As Long

    · bShow
    Specifies whether the internal display counter is to be incremented or decremented. If bShow is TRUE, the display count is incremented by one. If bShow is FALSE, the display count is decremented by one.
    This means if you call ShowCursor(False) for 5 times, you have to call it ShowCursor(True) 5 times before the cursor shows again.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
    2. Private Sub Form_Load()
    3.     'KPD-Team 1998
    4.     'URL: [url]http://www.allapi.net/[/url]
    5.     'E-Mail: [email][email protected][/email]
    6.     'Hide the cursor
    7.     ShowCursor 0
    8.     'Wait 10 seconds
    9.     t = Timer
    10.     Do: DoEvents: Loop Until Timer > t + 10
    11.     'Show the cursor
    12.     ShowCursor 1
    13. End Sub

  4. #4
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    We've used the same source

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Yes we did, and you beat me to the punch!

  6. #6
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    I always have API-Guide in the tray

  7. #7

    Thread Starter
    Hyperactive Member Pozzi's Avatar
    Join Date
    Feb 2001
    Location
    The Stones!
    Posts
    507

    Many Thanks

    Many thanks both!

    While we're on the subject do either of you know how to do the same in Delphi?

    Regards
    VB.Net (VS 2010)

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Can you use Windows based APIs in Delphi?

    I'm guessing the declarations would be different, but ShowCursor is part of the User32 library which is present on all Windows based machines.

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