Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 3: Windows Resources


If you do not want to show a cursor, you can use the Wind32 API ShowCursor()
function. Its syntax is:

int ShowCursor(BOOL bShow);

To hide a cursor, specify the argument as FALSE.

Practical Learning: Creating a Cursor



  1. To create a new cursor, on the main menu, click Project -> Add Resource

  2. In the Insert Resource or Add Resource dialog box, click Cursor and click New

  3. In the Resource View, right-click the name of the cursor and click Properties

  4. Change its ID to IDC_APP_CURS and its Filename to appcurs.cur

  5. On the Toolbox, click the Line tool and select the black color

  6. Design the cursor as follows:

  7. To define the hot spot, on the toolbar of the editor, click the Set Hot Spot button
    . Click the middle of the square:

  8. Save All

  9. Close the Cursor Properties window.

Free download pdf