IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Contribuez Delphi Discussion :

Utiliser les boites de dialogue Vista (TaskDialogIndirect)


Sujet :

Contribuez Delphi

  1. #1
    Membre chevronné

    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    935
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 935
    Points : 1 765
    Points
    1 765
    Par défaut Utiliser les boites de dialogue Vista (TaskDialogIndirect)
    Salut

    Windows fournit une API appelée TaskDialogIndirect qui permet de creer des boites de dialogues style Vista personnalisables a souhait. (voir http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx et http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx). Malheureusement, la fonction demande beaucoup de parametres.

    L'API permet de creer des boites de dialogues pouvant contenir :
    - des CommandLink ou des boutons personnalisables,
    - des RadioButtons,
    - une CheckBox (genre "Ne plus afficher ce message"),
    - un bouton Expand,
    - une barre de progression
    - des hyperliens ...

    De plus, elle permet de gerer des évenements qui sont appelés automatiquement par la boite de dialogue. (propriété OnCallBack du TTaskDialog)

    J'ai donc créé une unité qui permet de faciliter grandement la création de ces boites de dialogues Vista. Voila son code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    unit VistaTaskDialog;
     
    interface
     
    uses Windows;
     
    const
      TD_ICON_BLANK = 0;
      TD_ICON_WARNING = 84;
      TD_ICON_QUESTION = 99;
      TD_ICON_ERROR = 98;
      TD_ICON_INFORMATION = 81;
     
      TD_ICON_SHIELD = 65532;
      TD_ICON_SHIELD_QUESTION = 104;
      TD_ICON_SHIELD_ERROR = 105;
      TD_ICON_SHIELD_OK = 106;
      TD_ICON_SHIELD_WARNING = 107;
      TD_ICON_SHIELD_HEADB = 65531;
      TD_ICON_SHIELD_HEAD_WARNING = 65530;
      TD_ICON_SHIELD_HEAD_ERROR = 65529;
      TD_ICON_SHIELD_HEAD_OK = 65528;
      TD_ICON_SHIELD_HEADG = 65527;    
     
      TD_ICON_SOUND_WARNING = 65535;
      TD_ICON_SOUND_ERROR   = 65534;
      TD_ICON_SOUND_INFORMATION = 65533;
     
      TD_BUTTON_OK     = $01;
      TD_BUTTON_YES    = $02;
      TD_BUTTON_NO     = $04;
      TD_BUTTON_CANCEL = $08;
      TD_BUTTON_RETRY  = $10;
      TD_BUTTON_CLOSE  = $20;
     
      TD_RESULT_OK     = 1;
      TD_RESULT_CANCEL = 2;
      TD_RESULT_RETRY  = 4;
      TD_RESULT_YES    = 6;
      TD_RESULT_NO     = 7;
      TD_RESULT_CLOSE  = 8;
     
      TD_RESULT_ERROR = -1;
     
      TDF_ENABLE_HYPERLINKS           =  $0001;
      TDF_USE_HICON_MAIN              =  $0002;
      TDF_USE_HICON_FOOTER            =  $0004;
      TDF_ALLOW_DIALOG_CANCELLATION   =  $0008;
      TDF_USE_COMMAND_LINKS           =  $0010;
      TDF_USE_COMMAND_LINKS_NO_ICON   =  $0020;
      TDF_EXPAND_FOOTER_AREA          =  $0040;
      TDF_EXPANDED_BY_DEFAULT         =  $0080;
      TDF_VERIFICATION_FLAG_CHECKED   =  $0100;
      TDF_SHOW_PROGRESS_BAR           =  $0200;
      TDF_SHOW_MARQUEE_PROGRESS_BAR   =  $0400;
      TDF_CALLBACK_TIMER              =  $0800;
      TDF_POSITION_RELATIVE_TO_WINDOW =  $1000;
      TDF_RTL_LAYOUT                  =  $2000;
      TDF_NO_DEFAULT_RADIO_BUTTON     =  $4000;
      TDF_CAN_BE_MINIMIZED            =  $8000;
     
    type
      TTaskDialogCallBackProc = function (AHWND : HWND; Notification : Cardinal; WParam : wParam; LParam : lParam; dwRefData : Pointer) : integer;
     
      TTaskIcon = record
        case boolean of
          false : (hIcon : HICON);
          true  : (pszIcon : PWideChar);
        end;
     
      TTaskDialogButton = record
        nButtonID     : Integer;
        pszButtonText : PWideChar;
      end;
     
      TArrayTaskDialogButton = array of TTaskDialogButton;
     
      TTaskButtons = record
        NbButtons : Cardinal;
        CustomButtons : TArrayTaskDialogButton;
        DefaultButton : integer;
      end;        
     
      TTaskDialogConfig = record
        cbSize : Cardinal;
        HwndParent : HWND;
        hInstance : THandle;
        dwFlags : Cardinal;
        dwCommonButtons : Cardinal;
     
        pszWindowTitle : PWideChar;
        MainIcon : TTaskIcon;
        pszMainInstruction : PWideChar;
        pszContent : PWideChar;
     
        Buttons : TTaskButtons;
     
        RadioButtons : TTaskButtons;
     
        pszVerificationText : PWideChar;
     
        pszExpandedInformation : PWideChar;
        pszExpandedControlText : PWideChar;
        pszCollapsedControlText : PWideChar;
     
        FooterIcon : TTaskIcon;
        pszFooter : PWideChar;
     
        pfCallback : ^TTaskDialogCallBackProc;
        lpCallBackData : Pointer;
     
        cxWidth : Cardinal;
      end;
     
      PTaskDialogConfig = ^TTaskDialogConfig;
     
     
      TButtonTextID = record
        nButtonID     : Integer;
        pszButtonText : WideString;
      end;
     
      TTaskDialog = class
      private
        FArrayButtons, FArrayRadioButtons : array of TButtonTextID;
        FDefaultButton, FDefaultRadioButton : integer;
     
        FWindowTitle : WideString;
        FMainInstruction : WideString;
        FContent : WideString;
     
        FVerificationText : WideString;
        FExpandedInformation : WideString;
        FExpandedControlText : WideString;
        FCollapsedControlText : WideString;
        FFooterText : WideString;
     
        FMainIcon, FFooterIcon : TTaskIcon;
     
        FHandleParent : HWND;
        FInstance : THandle;
     
        FFlags : Cardinal;
        FCommonButtons : Cardinal;
     
        FCallback : TTaskDialogCallBackProc;
        FCallBackData : Pointer;
     
        FWidth : Cardinal;
      public
        constructor Create;
        destructor Destroy; override;
     
        function Execute (out Button, RadioButton : integer; out VerifChecked : boolean) : integer;
        procedure AddCustomButton (ButtonID : integer; ButtonText : WideString);
        procedure AddRadioButton (ButtonID : integer; ButtonText : WideString);
        procedure InitializeConfig;
        function HyperLink(ExecutableName, Text : Widestring) : WideString;
     
        property HandleParent : HWND read FHandleParent write FHandleParent;
        property hInstance : THandle read FInstance write FInstance;
     
        property WindowTitle     : WideString read FWindowTitle     write FWindowTitle;
        property MainInstruction : WideString read FMainInstruction write FMainInstruction;
        property Content         : WideString read FContent         write FContent;
     
        property VerificationText     : WideString read FVerificationText     write FVerificationText;
        property ExpandedInformation  : WideString read FExpandedInformation  write FExpandedInformation;
        property ExpandedControlText  : WideString read FExpandedControlText  write FExpandedControlText;
        property CollapsedControlText : WideString read FCollapsedControlText write FCollapsedControlText;
        property FooterText           : WideString read FFooterText           write FFooterText;
     
        property DefaultButton      : integer read FDefaultButton      write FDefaultButton;
        property DefaultRadioButton : integer read FDefaultRadioButton write FDefaultRadioButton;
     
        property MainIcon   : TTaskIcon read FMainIcon   write FMainIcon;
        property FooterIcon : TTaskIcon read FFooterIcon write FFooterIcon;
     
        property Flags         : Cardinal read FFlags         write FFlags;
        property CommonButtons : Cardinal read FCommonButtons write FCommonButtons;
        property Width         : Cardinal read FWidth         write FWidth;
     
        property CallBackData : Pointer read FCallBackData write FCallBackData;
        property OnCallBack : TTaskDialogCallBackProc read FCallBack write FCallBack;
      end;
     
     
    implementation
     
    const
      TaskDialogIndirectSig = 'TaskDialogIndirect';
     
    function IsWindowsVista: Boolean;
    var
      VerInfo: TOSVersioninfo;
    begin
      VerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
      GetVersionEx(VerInfo);
      Result := VerInfo.dwMajorVersion >= 6;
    end;
     
    constructor TTaskDialog.Create;
    begin
      inherited;
     
      InitializeConfig;
    end;
     
     
    destructor TTaskDialog.Destroy;
    begin       
      InitializeConfig;
     
      inherited;
    end;
     
    procedure TTaskDialog.InitializeConfig;
    var i : integer;
    begin
      for i:=0 to Length(FArrayButtons)-1 do
        FArrayButtons[i].pszButtonText:='';
     
      for i:=0 to Length(FArrayRadioButtons)-1 do
        FArrayRadioButtons[i].pszButtonText:='';
     
      SetLength(FArrayButtons,0);
      SetLength(FArrayRadioButtons,0);
      FDefaultButton:=0;
      FDefaultRadioButton:=0;
     
      FWindowTitle:= '';;
      FMainInstruction := '';;
      FContent :='';
     
      FVerificationText:='';
      FExpandedInformation:='';
      FExpandedControlText:='';
      FCollapsedControlText:='';
     
      FMainIcon.hIcon:=0;
      FFooterIcon.hIcon:=0;
     
      FHandleParent := 0;
      FInstance := 0;
     
      FFlags := 0;
      FCommonButtons := 0;
      FWidth :=0;
    end;
     
     
     
    procedure TTaskDialog.AddCustomButton (ButtonID : integer; ButtonText : WideString);
    var L : integer;
    begin
      L:=Length(FArrayButtons);
      SetLength(FArrayButtons,L+1);
      FArrayButtons[L].pszButtonText:=ButtonText;
      FArrayButtons[L].nButtonID:=ButtonID;
    end;
     
    procedure TTaskDialog.AddRadioButton (ButtonID : integer; ButtonText : WideString);
    var L : integer;
    begin
      L:=Length(FArrayRadioButtons);
      SetLength(FArrayRadioButtons,L+1);
      FArrayRadioButtons[L].pszButtonText:=ButtonText;
      FArrayRadioButtons[L].nButtonID:=ButtonID;
    end;
     
    function TTaskDialog.HyperLink(ExecutableName, Text : Widestring) : WideString;
    begin
      Result:='<A HREF="'+ExecutableName+'">'+Text+'</A>';
    end;
     
    function TTaskDialog.Execute (out Button, RadioButton : integer; out VerifChecked : boolean) : integer;
    var AButtons, ARadioButtons : TTaskButtons;
        i : integer;
        FConfig : TTaskDialogConfig;
        FDLLHandle : THandle;
        FTaskDialogIndirect : function(Config: PTaskDialogConfig; pnButton, pnRadioButton : PInteger;
                                       VerificationFlagChecked : PBoolean): integer; cdecl stdcall;
    begin
      Result:=TD_RESULT_ERROR;
      if IsWindowsVista then
      begin
        FDLLHandle := LoadLibrary(comctl32);
        if FDLLHandle >= 32 then
        begin
          @FTaskDialogIndirect := GetProcAddress(FDLLHandle, TaskDialogIndirectSig);
     
          if Assigned(FTaskDialogIndirect) then
          begin
            FConfig.HwndParent:=FHandleParent;
            FConfig.hInstance:=FInstance;
            FConfig.dwFlags:=FFlags;
            FConfig.dwCommonButtons:=FCommonButtons;
            FConfig.pszWindowTitle:=@FWindowTitle[1];
            FConfig.MainIcon:=FMainIcon;
            FConfig.pszMainInstruction:=@FMainInstruction[1];
            FConfig.pszContent:=@FContent[1];
     
            //création du tableau de boutons
            AButtons.DefaultButton:=FDefaultButton;
            AButtons.NbButtons:=Length(FArrayButtons);
            SetLength(AButtons.CustomButtons,AButtons.NbButtons);
            for i:=0 to AButtons.NbButtons-1 do
            begin
              AButtons.CustomButtons[i].pszButtonText:=@FArrayButtons[i].pszbuttonText[1];
              AButtons.CustomButtons[i].nButtonID:=FArrayButtons[i].nButtonID;
            end;
            FConfig.Buttons:=AButtons;
     
            //création du tableau de radiobuttons
            ARadioButtons.DefaultButton:=FDefaultRadioButton;
            ARadioButtons.NbButtons:=Length(FArrayRadioButtons);
            SetLength(ARadioButtons.CustomButtons,AButtons.NbButtons);
            for i:=0 to ARadioButtons.NbButtons-1 do
            begin
              ARadioButtons.CustomButtons[i].pszButtonText:=@FArrayRadioButtons[i].pszbuttonText[1];
              ARadioButtons.CustomButtons[i].nButtonID:=FArrayRadioButtons[i].nButtonID;
            end;
            FConfig.RadioButtons:=ARadioButtons;
     
            FConfig.pszVerificationText:=@FVerificationText[1];
            FConfig.pszExpandedInformation:=@FExpandedInformation[1];
            FConfig.pszExpandedControlText:=@FExpandedControlText[1];
            FConfig.pszCollapsedControlText:=@FCollapsedControlText[1];
            FConfig.FooterIcon:=FFooterIcon;
            FConfig.pszFooter:=@FFooterText[1];
            FConfig.pfCallback:=@FCallBack;
            FConfig.lpCallBackData:=FCallBackData;
            FConfig.cxWidth:=FWidth;
            FConfig.cbSize:=SizeOf(FConfig);
     
            Result:=FTaskDialogIndirect(@FConfig, @Button, @RadioButton, @VerifChecked);
     
            SetLength(AButtons.CustomButtons,0);
            SetLength(ARadioButtons.CustomButtons,0);
          end;
        end;
        FreeLibrary(FDLLHandle);
      end;
    end;
     
    end.
    Quelques exemples d'utilisation :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    var TaskD : TTaskDialog;
        Resultat, Bouton, RadioBouton : integer;
        Checked : boolean;
        MainIc, FootIc : TTaskIcon;
     
    ...
     
      TaskD:=TTaskDialog.Create;
      TaskD.HandleParent:=Handle;
      TaskD.WindowTitle:='Boite de dialogue complexe';
      TaskD.MainInstruction:='Instruction principale';
      TaskD.Content:='Contenu';
      TaskD.FooterText:='FooterText';
      TaskD.CommonButtons:=TD_BUTTON_OK or TD_BUTTON_RETRY;
      TaskD.CollapsedControlText:='CollapsedControlText';
      TaskD.ExpandedControlText:='ExpandedControlText';
      TaskD.ExpandedInformation:='ExpandedInformation';
      TaskD.AddCustomButton(8,'Custom Button 1');
      TaskD.AddCustomButton(9,'Custom Button 2');
      TaskD.AddRadioButton(1,'RadioButton 1');
      TaskD.AddRadioButton(2,'RadioButton 2');
     
      TaskD.Flags:=TDF_USE_COMMAND_LINKS or TDF_SHOW_PROGRESS_BAR or TDF_EXPAND_FOOTER_AREA or TDF_EXPANDED_BY_DEFAULT;
     
      MainIc.hIcon:=TD_ICON_SHIELD_QUESTION;
      TaskD.MainIcon:=MainIc;
      FootIc.hIcon:=TD_ICON_WARNING;
      TaskD.FooterIcon:=FootIc;
     
      Resultat:=TaskD.Execute(Bouton,RadioBouton,Checked);
     
      TaskD.Free;
    donne :



    ---------------------------------------------------------------

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    var TaskD : TTaskDialog;
        Resultat, Bouton, RadioBouton : integer;
        Checked : boolean;
        MainIc : TTaskIcon;
     
    ...
     
      TaskD:=TTaskDialog.Create;
      TaskD.HandleParent:=Handle;
      TaskD.WindowTitle:='Modification du document';
      TaskD.MainInstruction:='Voulez vous sauvegarder les changements ?';
      TaskD.Content:='Le contenu du document a été modifié. Quitter sans sauvegarder annulera les modifications apportées a ce document depuis la derniere sauvegarde';
      TaskD.AddCustomButton(1,'Enregistrer les changements'#10'Enregistre les changements et quitte le logiciel');
      TaskD.AddCustomButton(3,'Ne pas enregistrer'#10'Quitte le logiciel sans enregistrer');
      TaskD.AddCustomButton(TD_BUTTON_CANCEL,'Annuler'#10'Retourner sur le logiciel');
      TaskD.DefaultButton:=TD_BUTTON_CANCEL;
      MainIc.hIcon:=TD_ICON_QUESTION;
     
      TaskD.MainIcon:=MainIc;
      TaskD.Flags:=TDF_USE_COMMAND_LINKS or TDF_ALLOW_DIALOG_CANCELLATION;
     
      Resultat:=TaskD.Execute(Bouton,RadioBouton,Checked);
     
      case Resultat of
        S_OK             : begin //Execution OK
                             case Bouton of
                               1                : ShowMessage('Enregistre et quitte');
                               3                : ShowMessage('Quitte sans enregistrer');
                               TD_BUTTON_CANCEL : ShowMessage('Annule');
                             end;
                           end;
        TD_RESULT_ERROR  : begin   //erreur si pas Vista
                             ShowMessage('Vous n''avez pas Vista !');
                           end;
        E_OUTOFMEMORY    : ShowMessage('Erreur mémoire');
        E_INVALIDARG     : ShowMessage('Arguments invalides');
        E_FAIL           : ShowMessage('Erreur inconnue');
      end;
      TaskD.Free;
    donne :






    Liste des constantes :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    //Icones classiques
      TD_ICON_BLANK = 0;
      TD_ICON_WARNING = 84;
      TD_ICON_QUESTION = 99;
      TD_ICON_ERROR = 98;
      TD_ICON_INFORMATION = 81;
     
    //Icones avec un bouclier
      TD_ICON_SHIELD = 65532;
      TD_ICON_SHIELD_QUESTION = 104;
      TD_ICON_SHIELD_ERROR = 105;
      TD_ICON_SHIELD_OK = 106;
      TD_ICON_SHIELD_WARNING = 107;
     
    //Icones avec un bouclier et un bandeau de couleur (le bandeau ne marche pas pour le FooterIcon)
      TD_ICON_SHIELD_HEADB = 65531;
      TD_ICON_SHIELD_HEAD_WARNING = 65530;
      TD_ICON_SHIELD_HEAD_ERROR = 65529;
      TD_ICON_SHIELD_HEAD_OK = 65528;
      TD_ICON_SHIELD_HEADG = 65527;    
     
    //Icones qui permettent a la fenetre de produire un bruit lors de l'apparition
      TD_ICON_SOUND_WARNING = 65535;
      TD_ICON_SOUND_ERROR   = 65534;
      TD_ICON_SOUND_INFORMATION = 65533;
     
    //Boutons classiques (CommonButtons)
      TD_BUTTON_OK     = $01;
      TD_BUTTON_YES    = $02;
      TD_BUTTON_NO     = $04;
      TD_BUTTON_CANCEL = $08;
      TD_BUTTON_RETRY  = $10;
      TD_BUTTON_CLOSE  = $20;
     
    //Valeur de retour des boutons classiques
      TD_RESULT_OK     = 1;
      TD_RESULT_CANCEL = 2;
      TD_RESULT_RETRY  = 4;
      TD_RESULT_YES    = 6;
      TD_RESULT_NO     = 7;
      TD_RESULT_CLOSE  = 8;
     
      TD_RESULT_ERROR = -1;
     
    //Flags permettant de personnaliser la boite de dialogue
      TDF_ENABLE_HYPERLINKS           =  $0001;
      TDF_USE_HICON_MAIN              =  $0002;
      TDF_USE_HICON_FOOTER            =  $0004;
      TDF_ALLOW_DIALOG_CANCELLATION   =  $0008;
      TDF_USE_COMMAND_LINKS           =  $0010;
      TDF_USE_COMMAND_LINKS_NO_ICON   =  $0020;
      TDF_EXPAND_FOOTER_AREA          =  $0040;
      TDF_EXPANDED_BY_DEFAULT         =  $0080;
      TDF_VERIFICATION_FLAG_CHECKED   =  $0100;
      TDF_SHOW_PROGRESS_BAR           =  $0200;
      TDF_SHOW_MARQUEE_PROGRESS_BAR   =  $0400;
      TDF_CALLBACK_TIMER              =  $0800;
      TDF_POSITION_RELATIVE_TO_WINDOW =  $1000;
      TDF_RTL_LAYOUT                  =  $2000;
      TDF_NO_DEFAULT_RADIO_BUTTON     =  $4000;
      TDF_CAN_BE_MINIMIZED            =  $8000;
    Note :
    • Ajoutez obligatoirement un XPManifest sur votre form
    • Si vous ne spécifiez pas de HandleParent, votre boite de dialogue se comportera comme si elle n'était pas modale.
    • Pour écrire en petit dans un bouton de type CommandLink, ajoutez un #10. (le #13 permet de mettre le caption du bouton sur plusieurs lignes)


    Minimum supported client : Windows Vista
    Minimum supported server : Windows Server 2008

    Voila, j'espere que j'ai été clair ^^

    Si vous avez des questions ou des modifications a apporter, faites moi signe !

    A+

    Mick605

  2. #2
    Rédacteur/Modérateur
    Avatar de ero-sennin
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2005
    Messages
    2 965
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2005
    Messages : 2 965
    Points : 4 935
    Points
    4 935
    Par défaut
    Salut,

    Merci à toi pour cette source

  3. #3
    Modérateur
    Avatar de Rayek
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2005
    Messages
    5 235
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 235
    Points : 8 504
    Points
    8 504
    Par défaut
    A rajouter

    Minimum supported client : Windows Vista
    Minimum supported server : Windows Server 2008
    Modérateur Delphi

    Le guide du bon forumeur :
    __________
    Rayek World : Youtube Facebook

  4. #4
    Membre chevronné

    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    935
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 935
    Points : 1 765
    Points
    1 765
    Par défaut
    Citation Envoyé par Rayek Voir le message
    A rajouter

    Minimum supported client : Windows Vista
    Minimum supported server : Windows Server 2008
    Ajouté !

  5. #5
    Modérateur
    Avatar de Rayek
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2005
    Messages
    5 235
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 235
    Points : 8 504
    Points
    8 504
    Par défaut
    un post très instructif sur le TTaskDialog
    Modérateur Delphi

    Le guide du bon forumeur :
    __________
    Rayek World : Youtube Facebook

  6. #6
    Membre chevronné

    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2009
    Messages
    935
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2009
    Messages : 935
    Points : 1 765
    Points
    1 765
    Par défaut
    Merci pour ce lien. Il faut savoir que cette source marche meme si le theme aéro est désactivé ... (sous Seven, du moins ...)

  7. #7
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Mai 2009
    Messages : 2
    Points : 3
    Points
    3
    Par défaut
    Merci pour cette source
    Je vais l'utiliser dans un programme de génération automatique de dialogues
    Je l'ai déjà fait avec le TaskDialog et je vais maintenant le faire avec TaskDialogIndirect. Allez voir ca sur mon site http://dxfile.free.fr

Discussions similaires

  1. Réponses: 3
    Dernier message: 07/02/2008, 19h44
  2. [FAQ] Utiliser la boite de dialogue selection d'un répertoire
    Par SfJ5Rpw8 dans le forum Vos Contributions VBScript
    Réponses: 4
    Dernier message: 16/03/2007, 07h38
  3. [VBA EXCEL]comment utiliser les boites a outils control sur une feuille excel
    Par EvaristeGaloisBis dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 13/02/2007, 19h04
  4. Réponses: 1
    Dernier message: 30/05/2005, 17h02
  5. personaliser Les boites de dialogue !!
    Par leo13 dans le forum Général JavaScript
    Réponses: 7
    Dernier message: 19/01/2005, 18h36

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo