Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2003-03-21
3
Medium Priority
?
440 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
  • 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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

572 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