Thema: Delphi Handcursorgrafik

Einzelnen Beitrag anzeigen

Nachteule

Registriert seit: 22. Mär 2007
Ort: München
37 Beiträge
 
Delphi 2009 Enterprise
 
#11

Re: Handcursorgrafik

  Alt 27. Aug 2008, 17:51
habe das hier gefunden:
// crHandPoint is slightly different from IDC_HAND

// Derived from postings to borland.public.cppbuilder.winapi and
// borland.public.delphi.winapi by CC Chong and MrBaseball34 on
// 18-19 Dec 2000

// Comments from CC Chong:
// "Yes IDC_HAND is the hidden resource of Windows. On Win98 and above (or since
// ActiveDesktop Update in IE4, if I'm not mistaken) Windows has the IDC_HAND
// cursor built in to the system."

// "But it is not the same as Delphi's crHandPoint. Delphi doesn't use Windows'
// IDC_HAND. crHandPoint is Delphi's own inclusion in it's Controls.res (found
// in your Delphi\lib)."
//
// "Delphi copies crHandPoint into your exe during linking.:
//
// Below, crHandpoint has a black "wrist band" that is not present with IDC_HAND.



Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

const
   // Declare the cursor constant that contains the resource identifier
   // of the system Hand cursor.

  IDC_HAND = MakeIntResource(32649);

  // Declare the cursor constant for our own use. Constant value must
  // not conflict with any existing Delphi cursor constant.

  NIDC_HAND = 32649;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  // oder on FormCreate
  Screen.Cursors[NIDC_HAND] := LoadCursor(0, IDC_HAND);
  
  Screen.Cursor := NIDC_HAND
end;

end.
so funzt es prima unter WinXP SP3
Miniaturansicht angehängter Grafiken
handcursor_132.jpg  
  Mit Zitat antworten Zitat