uses registry; function IE_Installed : Boolean; var Reg: TRegistry; s: String; begin Reg:=TRegistry.Create; With Reg do Begin RootKey:=HKEY_LOCAL_MACHINE; ...
procedure TForm2.FormCreate(Sender: TObject); begin SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_APPWINDOW); end;
function DefMessageDlg( const ACaption: string; const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; DefButton: Integer; HelpCtx: Longint): Integer; var i: Integer; btn:...
procedure TForm1.Button1Click(Sender: TObject); begin if Opendialog1.Execute then begin {....} end; end; procedure TForm1.OpenDialog1Show(Sender: TObject); begin ...
uses DDEMan;{...} procedure SearchInFolder(Folder: string); begin with TDDEClientConv.Create(Self) do begin ConnectMode := ddeManual; ServiceApplication := 'Explorer.exe'; ...
uses ShellAPI, ShlOBJ; procedure AddToStartDocumentsMenu(sFilePath : string); begin SHAddToRecentDocs(SHARD_PATH, PChar( sFilePath ) ); end;
uses Filectrl; procedure TForm1.Button1Click(Sender: TObject); var Dir : String; begin SelectDirectory('Select a directory','',Dir); ShowMessage(Dir); end;
Si vous sélectionnez une image BMP, l'éditeur d'image par défaut se lance automatiquement. Dans cetexemple, nous allons rechercher l'application qui est associée au type de fichiers. ...
uses shellapi; //Thanks to Peter Below (TeamB) for this code procedure PropertiesDialog(filename:String); var sei: TShellExecuteInfo; begin FillChar(sei, SizeOf(sei), 0); sei.cbSize :=...
//Thanks to Andreas Kosch for Help procedure OpenWith(FileName: String); begin ShellExecute(Application.Handle, 'open', PChar('rundll32.exe'), PChar('shell32.dll,OpenAs_RunDLL...
unit Unit1;interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ListBox1: TListBox; procedure FormCreate(Sender:...
function GetVersion : String; var VerInfoSize: DWord; VerInfo: Pointer; VerValueSize: DWord; VerValue: PVSFixedFileInfo; Dummy: DWord; begin VerInfoSize :=...
function GetFileLastAccessTime(sFileName : string ) : TDateTime; var ffd : TWin32FindData; dft : DWord; lft : TFileTime; h : THandle; begin // get file information h := Windows.FindFirstFile(...
function IsFileInUse(fName : string ) : boolean; var HFileRes : HFILE; begin Result := false; if not FileExists(fName) then exit; HFileRes := CreateFile(pchar(fName), GENERIC_READ or...
unit Unit1;interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TID3Tag = record ID: string[3]; Titel: string[30]; Artist: string[30]; ...
function getexetype(Filename:string):string; var BinaryType: DWORD; begin If GetBinaryType(Pchar(Filename), Binarytype) Then case BinaryType of SCS_32BIT_BINARY: Result:= 'Win32...
procedure TForm1.Button1Click(Sender: TObject); var S1 : String; F1 : File; FStruct : TOFSTRUCT; TheDate : TDateTime; Han1 : Integer; I : Integer; begin if Opendialog1.Execute then ...
Function Are2FilesEqual(Const fileName1, fileName2: String ):Boolean; Var ms1, ms2 : TMemoryStream; Begin Result := False; ms1 := TMemoryStream.Create; try ms1.LoadFromFile(fileName1); ...
procedure TForm1.Button1Click(Sender:TObject); begin if DirectoryExists('c:windows') then begin ShowMessage('Répertoire existant'); end; end;
uses Dialogs; begin {$I-} MkDir('c:windoof'); if IOResult 0 then MessageDlg('Le répertoire n'a pu être crée ! / Error', mtWarning, [mbOk], 0) else ...