Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1019
  • Last Modified:

How can I make my mouse cursor invisible in my Visual C++ windows application?

I am working on a windows application written in Visual C++ and I am trying to make my mouse cursor invisible when one of the windows is active.  Does anyone know how to make this happen?
0
pm77
Asked:
pm77
1 Solution
 
gstockCommented:
This function should do the trick:

int ShowCursor(
    BOOL bShow
);

When the window you want to hide the mouse cursor in gains focus, simply call the function passing a FALSE value.

ShowCursor(FALSE);

MSDN Reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Resources/Cursors/CursorReference/CursorFunctions/ShowCursor.asp

Hope this helps,
0
 
pm77Author Commented:
Thanks, that worked great the first time I tried it.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now