(*********************************************)
(* Name:Win32Dlg (Windows 32 Dialogs)        *)
(* Last Revision: 12 may 2005                *)
(* Version: 1.3                              *)
(*                                           *)
(* Copyright © 2000 - 2005, Christian Aaangel*)
(*********************************************)

unit Win32Dlg;

interface

Uses
 Dialogs;

Function Win32Dlg_Version: String;
Procedure Info(Msg: String);
Function PleaseConfirm(Msg: String; Buttons: TMsgDlgButtons): Word;
Procedure Error(Msg: String);
Procedure Warning(Msg: String);
Function WarningConfirm(Msg: String; Buttons: TMsgDlgButtons): Word;
Function Question(DCaption, DQuestion: String): String; // New in 1.1

Const
 QAbort = '!?!_AbOrTeD_!?!';

implementation

Function Win32Dlg_Version: String;
Begin
 Result := '1.1';
End;

Procedure Info(Msg: String);
Begin
 Messagedlg(Msg, mtInformation, [mbOk], 0);
End;

Function PleaseConfirm(Msg: String; Buttons: TMsgDlgButtons): Word;
Begin
 Result := Messagedlg(Msg, mtconfirmation, Buttons, 0);
End;

Procedure Error(Msg: String);
Begin
 Messagedlg(Msg, mtError, [mbOk], 0);
End;

Procedure Warning(Msg: String);
Begin
 Messagedlg(Msg, mtWarning, [mbOk], 0);
End;

Function WarningConfirm(Msg: String; Buttons: TMsgDlgButtons): Word;
Begin
 Result := Messagedlg(Msg, mtWarning, Buttons, 0);
End;

Function Question(DCaption, DQuestion: String): String; // New in 1.1
Var
 Answer: String;
Begin
 If InputQuery(DCaption, DQuestion, Answer) then Result := Answer
  else Result := QAbort;
End;

end.
