![how to change your cursor on windows xp how to change your cursor on windows xp](https://i.ytimg.com/vi/9jb2164lse4/maxresdefault.jpg)
- #How to change your cursor on windows xp 64 Bit
- #How to change your cursor on windows xp drivers
- #How to change your cursor on windows xp code
It must be that the hotspot is set incorrectly. OP has thoroughly observed this by even writing a program to test just where that misbehaved I-beam cursor is clicking.
![how to change your cursor on windows xp how to change your cursor on windows xp](https://1.bp.blogspot.com/-xWd9jEX4Bf4/VMlbGwBMtMI/AAAAAAAAVV0/n7Wb8q8l7kA/s1600/Screenshot%2B(9).png)
If you open Notepad, and then move your cursor to the bottom edge, out of the text region, and observe the change between I-beam and pointer, you can see that the pointer begins two pixels to the left of the I-beam. This was plaguing me for many years, and evidently many other Windows users? Do you ever just click between two characters, but the text caret ends up too far to the left? Your cursor was clearly between the other two! (I also noticed that the answer to this other question has some interesting information about the different way that I-Beam cursors are handled. As Mark points out this is likely the cause of the visual discrepency, but why has this occurred, and how might I fix it? However, when I dump the bitmap for the cursor (the hbmMask member of the ICONINFO struct, as it is a monochrome cursor), the vertical bar is 10 pixels from the left of the image, not 8 pixels. The ICONINFO struct for the cursor indicates that the x coord for the cursor hotspot is at x=8. Am I doing something wrong with the way that I'm handling the incoming cursor coordinates?ĮDIT: More Information After Insightful Questions in the CommentsĪs guided by Ransom in the comments, I've used the GetIconInfo function to get more information about the I-Beam cursor. I've done loads of googling for answers, but can't find anything relevant. paint vertical red line at position of last click global ints for the purpose of this test Here are the relevant parts from my main message loop: case WM_LBUTTONDOWN: Wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)) Wcex.lpszMenuName = MAKEINTRESOURCE(IDC_CURSOR_TEST) Wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) Wcex.hCursor = LoadCursor(NULL, IDC_IBEAM) // this is the only line I changed in this function Wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CURSOR_TEST))
![how to change your cursor on windows xp how to change your cursor on windows xp](https://i.ytimg.com/vi/71TPr0mkftc/hqdefault.jpg)
#How to change your cursor on windows xp code
Here's the code where I register the window class and set the cursor to an I Beam ATOM MyRegisterClass(HINSTANCE hInstance) My test project is basically the "Win32 Project" template in Visual C++ 2010, with the changes outlined below. Choosing different cursors in display preferences makes no difference Switching aero on or off makes no difference.
#How to change your cursor on windows xp drivers
#How to change your cursor on windows xp 64 Bit
I've had someone else running Windows 7 64 bit confirm that they experience the same problem, but another tester on Vista does not have the problem. I would expect the red line to match up exactly with the vertical part of the I-Beam, but this is not the case.Īs you can see, the red line is two pixels to the left of where it should be (the behaviour is correct for the standard arrow pointer), so it appears that the hotspot for the I-Beam cursor is wrong. All it does is turn the cursor into an IBeam and render a vertical red line where the last mouse down event was. I've written a very simple win32 program to demonstrate the problem. Basically, the x-coordinate is always two pixels left of where it should be. On windows, the coordinates returned for a "mouse button down" event seem to be slightly wrong for an I-Beam cursor.