Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9209721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:54:43+00:00 2026-06-18T00:54:43+00:00

Win32 newbie here. I’ve been having some issues with using one of the standard

  • 0

Win32 newbie here. I’ve been having some issues with using one of the standard WinAPI cursors: IDC_CROSS. When creating a new class, I set the class cursor to be IDC_CROSS, a crosshair. However, when I run the program my cursor never changes and is always the standard arrow.

ATOM MyRegisterClass(HINSTANCE hInstance)
{
    WNDCLASSEX wcex;

    wcex.cbSize = sizeof(WNDCLASSEX);

    wcex.style          = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc    = WndProc;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
    wcex.hIcon          = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINSCREENCAP));
    wcex.hCursor        = LoadCursor(NULL, IDC_CROSS);
    wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName   = MAKEINTRESOURCE(IDC_WINSCREENCAP);
    wcex.lpszClassName  = szWindowClass;
    wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

    return RegisterClassEx(&wcex);
}

I’m using VC++ 2010 Express, and this happens even when I create a new (non-empty) Win32 project and change only the class cursor value. Is there something horribly obvious that I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:54:45+00:00Added an answer on June 18, 2026 at 12:54 am

    The window class cursor is set correctly. You may want to check that the class registration succeeds (RegisterClassEx returns a non-zero value), and that the window is actually created based on this class registration. The main thing to watch out for is that the CreateWindow function is called with the same window class name and HINSTANCE value. You could also check that LoadCursor actually returns a non-zero value. If LoadCursor fails for some reason it returns zero and Windows will default to the standard cursor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use perl and Win32::OLE to automate some Excel task. Because of the Excel
So I have a WIN32 app that records videos using DirectShow. Now I want
I'm using the Win32 function GetEnvironmentVariable to retrieve the value of a variable that
I am using the Win32 API call SetForegroundWindow to set focus to another application's
I'm a complete WinDbg newbie and I've been trying to debug a WindowsXP problem
Win32's FindWindow() can find a window having the title of Untitled - Notepad, but
Using win32 API and Dynamic link library(dll) where to write the callback function in
In Win32 I want to suspend a thread using Suspend(GetCurrentThread()); but I find I
In Win32 layer, we often meet ERROR_PATH_NOT_FOUND , ERROR_NAME_NOT_FOUND . When does WinAPI(eg CreateFileW,
I've written some library code (in C) to facilitate creating and querying threads independent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.