unit kns; {$R-} interface uses Forms, Dialogs; { Центрирование информационного диалога } function MessageDlgCtr(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer; implementation uses Consts; { Функция MessageDlg располагает диалог над центром активного окна } function MessageDlgCtr(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;begin with CreateMessageDialog(Msg, DlgType, Buttons) dotryHelpContext := HelpCtx;Left := Screen.ActiveForm.Left + (Screen.ActiveForm.Width div 2) -(Width div 2); Top := Screen.ActiveForm.Top + (Screen.ActiveForm.Height div 2) -(Height div 2); Result := ShowModal;finallyFree;end;end; end. |