Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Cursor aus resource laden (https://www.delphipraxis.net/113929-cursor-aus-resource-laden.html)

k4ni 16. Mai 2008 20:50


Cursor aus resource laden
 
Hallo,

Ich hab schon ein paar themen gefunden, aber keine davon haben mir geholfen.
Ich habe 2 cursor in meiner .RES datei.

Hier erstmal die .rc datei:
Code:
1 CURSOR "Cursor 1.cur"
2 CURSOR "Cursor 2.cur"
Wieso geht das dann nicht: ?
Delphi-Quellcode:
var
  Form1: TForm1;

implementation
const
  cursors = 5;
{$R *.dfm}
{$R cursors.res}
procedure TForm1.FormCreate(Sender: TObject);
begin
  Screen.Cursors[cursors] := LoadCursor(HInstance, 'CURSOR');
  Cursor := cursors;
end;
end.

DeddyH 16. Mai 2008 20:54

Re: Cursor aus resource laden
 
Zitat:

Zitat von Win32 SDK
The LoadCursor function loads the specified cursor resource from the executable (.EXE) file associated with an application instance.

HCURSOR LoadCursor(

HINSTANCE hInstance, // handle of application instance
LPCTSTR lpCursorName // name string or cursor resource identifier
);


Parameters

hInstance

Identifies an instance of the module whose executable file contains the cursor to be loaded.

lpCursorName

Points to a null-terminated string that contains the name of the cursor resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can also be used to create this value.


k4ni 16. Mai 2008 20:58

Re: Cursor aus resource laden
 
Also mit 1 und 2 hab ichs auch schon versucht, ging nicht :/
edit: habs


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:21 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz