• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

SetSystemCursor + WIN2K ???

Hi,
I tried to set a systemwide new cursor with these lines:
..
  private
     NewArrow, OldArrow : HCursor;
..

{$R CURSORS.RES}

procedure TForm1.Button1Click(Sender: TObject);
begin
 NewArrow := LoadCursor(HINSTANCE,makeintresource(110));
 OldArrow := GetCursor; // LoadCursor(0, IDC_ARROW);
 SetSystemCursor(NewArrow, OCR_NORMAL);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
 SetSystemCursor(OldArrow, OCR_NORMAL);
end;
..

The cursor changed to the new one, but there is no way to change back !! Is this a w2k related problem or what can I do ?
0
Brainwashed2
Asked:
Brainwashed2
1 Solution
 
KristianCommented:
i dont know much about this, but surely your loading a cursor, and setting the system to use it, but your only setting the pointer back not the cursor, so on your second click your replacing the new cursor with the new cursor which has the effect of no change.
Kristian
0
 
gandalf_the_whiteCommented:
yes kristian is right

this line
>OldArrow := GetCursor; // LoadCursor(0, IDC_ARROW);
has to stand above this line
>NewArrow := LoadCursor(HINSTANCE,makeintresource(110));

0
 
Brainwashed2Author Commented:
no chance ! there is no problem to switch between IDC_ARROW and i.e. IDC_CROSS, but as soon i load an own *.cur the only way to replace is a reboot.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
KristianCommented:
Exactly you need to LOAD your old cursor back in NOT set the pointer back to it. coz the pointer has new data there. you will need to LOAD a new cursor again.
you only have a certain number of cursors open in windows at a time. if you replace one, to get the old one back you will need to load it in like you did when you loaded yours the first time.
Kristian.
0
 
CleanupPingCommented:
Brainwashed2:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
kacorretiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept Kristian's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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