Soyez le premier à donner votre avis sur cette source.
Vue 13 812 fois - Téléchargée 806 fois
procedure Split(const Delimiter: char; DelimitedText: string; var StrArray: TStrArray); var i, j, l: cardinal; k: byte; begin { Fill the dynamic array with the items of a text delimited } if (DelimitedText=EmptyStr) then begin SetLength(StrArray, 1); StrArray[0]:=EmptyStr; end else if (Delimiter=#0) then begin SetLength(StrArray, 1); StrArray[0]:=DelimitedText; end else begin l:=Length(DelimitedText); if (Copy(DelimitedText, l, 1)<>Delimiter) then begin DelimitedText:=DelimitedText + Delimiter; l:=l+1; end; SetLength(StrArray, 256); k:=0;j:=0; for i:=1 to l do if (DelimitedText[i]=Delimiter) then begin inc(k); strArray[k-1]:=Copy(DelimitedText, j+1, i-(j+1)); j:=i; end; SetLength(StrArray, k); end; end;
procedure TfrmDemo.frmDemoOnActivate(Sender: TObject);
procedure setCursor(hWnd:integer; lpCursorName:PAnsiChar);
var
hCur:integer;
begin
hCur:=LoadCursor(0, lpCursorName);
if (hcur<>0) then begin
SetClassLong(hWnd, GCL_HCURSOR, hCur);
DestroyCursor(hCur);
end;
end;
begin
//Déclare et affiche le caractère de délimitation
Delimiter:=';';
lblDelimiter.Caption:= 'Delimiter: "' + Delimiter + '"';
//Curseur des boutons
setCursor(btnSplit.Handle, IDC_HAND);
setCursor(btnClose.Handle, IDC_HAND);
end;
Declaration:
Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As String) As Long
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.
To use one of the Win32 predefined cursors, the application must set the hInstance parameter to NULL and the lpCursorName parameter to one the following values:
IDC_APPSTARTING
Standard arrow and small hourglass
IDC_ARROW
Standard arrow
IDC_CROSS
Crosshair
IDC_IBEAM
Text 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
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
Return values :
If the function succeeds, the return value is the handle of the newly loaded cursor.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
A+,
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.