Archive for August, 2007

31
Aug

delphi et VISTA…

pour ceux qui s’arrachent les cheveux: solution simple: DESACTIVER UAC

Points concernés: Impossible d’ecrire dans les repertoires: win, sys, program files (!), c:\

impossible d’ecrire dans la base de regsitre en LOCAL MACHINE

XML:
  1. <?xml version=“1.0″ encoding=“UTF-8″ standalone=“yes”?>
  2. <assembly xmlns=“urn:schemas-microsoft-com:asm.v1″ manifestVersion=“1.0″>
  3.         <dependency>
  4.                 <dependentAssembly>
  5.                         <assemblyIdentity
  6.                                 type=“win32″
  7.                                 name=“Microsoft.Windows.Common-Controls”
  8.                                 version=“6.0.0.0″
  9.                                 processorArchitecture=“X86″
  10.                                 publicKeyToken=“6595b64144ccf1df”
  11.                                 language=“*”
  12.                         />
  13.                 </dependentAssembly>
  14.         </dependency>
  15.        
  16. <trustInfo xmlns=“urn:schemas-microsoft-com:asm.v2″>
  17.                 <security>
  18.                         <requestedPrivileges>
  19.                                 <requestedExecutionLevel
  20.                                        level=“requireAdministrator”
  21.                                        uiAccess=“false”/>
  22.                         </requestedPrivileges>
  23.                 </security>
  24.         </trustInfo>
  25. </assembly>

        

 

enregistrez sous administrator.manifest
Creér ”administrator.rc” qui contient
1 24 “administrator.manifest”

(1 = numero de resource, 24 = type MANIFEST)

3) COMPILER :brcc32 administrator.rc

4) Ajouter au projet:

{$R ‘administrator.res’ ‘administrator.rc’}

VOILA !

27
Aug

delphi stay on top, TOUJOURS !

begin 

  SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height,
    SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
  //  Desktop
  SetWindowLong(Handle, GWL_HWNDPARENT, 0);
  // fenetre 
  SetWindowLong(Handle, GWL_EXSTYLE,
    GetWindowLong(Handle, GWL_EXSTYLE) or
    WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
end;

25
Aug

Activation Flash Activex sur Internet Explorer

Plusieurs méthodes à utiliser :
http://capitalhead.com/articles/activating-activex-controls.aspx

 Méthode intégrée dans www.dialogoo.com

22
Aug

delphi extraction nom du fichier sans extension

Voici la commande pour extraire le nom du fichier sans extension

filename := ChangeFileExt(ExtractFileName(’PathFileNameHere’),”);

ex: c:\windows\system.ini ->system

21
Aug

HTML et Flash: comment désactiver l’alerte activex dans une page HTML locale ?

insérer la ligne

<!– saved from url=(0013)about:internet –>

EN DEBUT de la page HTML (1ére ligne du code) ! 

20
Aug

Inno setup INF driver installation

 [Run]
 Filename: “{win}\rundll.exe”;
   Parameters: “setupx.dll,InstallHinfSection DefaultInstall 132
MYFILE.INF”

That won’t work on Windows NT/2000 (rundll.exe doesn’t exist). But this
should:

[Run]
Filename: “{win}\rundll.exe”; Parameters: “setupx.dll,InstallHinfSection
DefaultInstall 132 MYFILE.INF”; MinVersion: 1, 0
Filename: “{sys}\rundll32.exe”; Parameters: “setupapi,InstallHinfSection
DefaultInstall 132 MYFILE.INF”; MinVersion: 0, 1

17
Aug

INNO SETUP events

 http://www.vincenzo.net/isxkb/index.php?title=Test_events_example

voir aussi: http://www.vincenzo.net/isxkb/index.php?title=Special:Allpages

 

 

 

 

16
Aug

flash AS2 events add and remove

obj = new Object();
clicker = function (evt) {
    trace(”pressed”);
};
m1_mc.onPress = clicker;
delete(m1_mc.onPress);

Apparemment on ne peut pas utiliser addEventListener en AS2 avec MovieClip !

10
Aug

PHP et PAYPAL

générer un PDT
https://paypaltech.com/PDTGen/generate_pdt.php

 

générer un SG2
http://paypaltech.com/SG2/PHPDbSQL.php

09
Aug

JPEG smooth resize with Graphics32

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,JPEG, StdCtrls,   ExtCtrls, GR32, GR32_Image, GR32_Transforms, GR32_Resamplers, GR32_System;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    function RescalePic(aFileName,destinationFile: String;x,y:integer): TBitmap;

  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function TForm1.RescalePic(aFileName,destinationFile: String;x,y:integer): TBitmap;
Var
  R: TKernelResampler;
  ASrcImage: TBitMap32;
  ADstImage: TBitMap32;
  ABmp: TBitMap;
  AJPeg: TJPegImage;
  AScale: Extended;
  lPageIndex : Integer;
begin
  // Zum Abspeichern als Jpeg
  AJPeg     := TJPEGImage.Create;
  ABmp      := TBitMap.Create;
  // Original
  ASrcImage := TBitmap32.Create;
  // destintaion
  ADstImage := TBitMap32.Create;
  try
    ASrcImage.LoadFromFile(aFileName);
    ADstImage.Width  := x;
    ADstImage.Height := y;
    R := TKernelResampler.Create(ASrcImage);
    R.Kernel := TLanczosKernel.Create;

    ADstImage.Draw(ADstImage.BoundsRect, ASrcImage.BoundsRect, ASrcImage);
    ABmp.Assign(ADstImage);

    result := ABmp;
    AJPeg.Assign(ABmp);
    AJPeg.SaveToFile(destinationFile);

  finally
    AJPeg.Free;
    ADstImage.Free;
    ASrcImage.Free;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
        RescalePic(’c:\swftools\xpage1.jpg’,'c:\swftools\xpage1.jpg2.jpg’,400,300);
end;

end.