?
Solved

Getting a hand shape mouse-pointer with shadow on windows 2000/xp using delphi 7

Posted on 2003-03-21
3
Medium Priority
?
424 Views
Last Modified: 2010-04-04
Hi folks,

Currently i am programming an application that uses labels that act as hyperlinks (they have a blue color and an underlined font). When hovering over these labels I want the mouse-pointer to act exactly as it does in Microsoft's Internet Explorer.

Surprisingly I didn't get the standard hand-shaped mouse pointer when setting the cursor-property of the label to crHandPoint. After searching a while on the internet, I found a patch witch describes replacing the ugly hand-pointer delivered with delphi by the Internet Explorer-style hand-pointer. This already improved the mouse pointer's look a lot.. but still there is something missing.. the pointer-shadow.

When choosing a mouse-pointer different from crDefault for the Cursor-property of a label, the mouse-pointer looses it's beautiful shadow when moving it over the label. Please mention that this only occurs on Windows 2k and Windows XP systems as they are the only Microsoft operating systems that support mouse-pointer shadows.

Now my question is: Is there a way (in delphi 7 on Windows 2000 or XP systems) to use the hand shape mouse-pointer without loosing it's shadow? If you want to provide an answer to my question, please (try to) post (a link to) sourcecode implementing your solution.

Thanks in advance,

MrGuide
0
Comment
Question by:mrguide
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Expert Comment

by:mocarts
ID: 8184735
in any of your units place this at very end:

var
  h: HICON;
initialization
  h := LoadCursor(0, IDC_HAND);
  if h <> 0 then begin
    DestroyCursor(Screen.Cursors[crHandPoint]);
    Screen.Cursors[crHandPoint] := h;
    // you can put here as many replacements as you want
  end;
end.

other possible LoadCursor function param values:

IDC_APPSTARTING - Standard arrow and small hourglass
IDC_ARROW - Standard arrow
IDC_CROSS - Crosshair
IDC_HAND - Windows 98/Me, Windows 2000/XP: Hand
IDC_HELP - Arrow and question mark
IDC_IBEAM - I-beam
IDC_ICON - Obsolete for applications marked version 4.0 or later.
IDC_NO - Slashed circle
IDC_SIZE - Obsolete for applications marked version 4.0 or later. Use IDC_SIZEALL.
IDC_SIZEALL - Four-pointed arrow pointing north, south, east, and west
IDC_SIZENESW - Double-pointed arrow pointing northeast and southwest
IDC_SIZENS - Double-pointed arrow pointing north and south
IDC_SIZENWSE - Double-pointed arrow pointing northwest and southeast
IDC_SIZEWE - Double-pointed arrow pointing west and east
IDC_UPARROW - Vertical arrow
IDC_WAIT - Hourglass

wbr, mo.
0
 
LVL 9

Accepted Solution

by:
mocarts earned 300 total points
ID: 8185716
you must ommit line with DestroyCursor as it will be called automatically on setting new cursor.

var
 h: HICON;
initialization
 h := LoadCursor(0, IDC_HAND);
 if h <> 0 then begin
   Screen.Cursors[crHandPoint] := h;
   // you can put here as many replacements as you want
 end;
end.

wbr, mo.
0
 

Author Comment

by:mrguide
ID: 8558682
Sorry for the delay. You have perfectly solved my problem.

Thank you very much.

MrGuide
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question