Einzelnen Beitrag anzeigen

Benutzerbild von 010101
010101

Registriert seit: 27. Nov 2014
34 Beiträge
 
#12

AW: Titelleiste / Rahmen der MessageDlg ausblenden

  Alt 1. Dez 2014, 16:42
Beispiel mit ausführbarer EXE im Anhang.

Um das Beispiel noch einfacher zu machen das alles noch einmal als Prozedur und nicht als Funktion.

Delphi-Quellcode:
procedure MsgBox(psCaption: string; psText: string; nHeigth: Integer; aMsgDlgType: TMsgDlgType; aMsgDlgBtn: TMsgDlgButtons; aMsgDlgBtnDef: TMsgDlgBtn);
var
  aMsgDialog: TForm; // versehentlich vergessen ..
begin
  aMsgDialog := CreateMessageDialog(psText, aMsgDlgType, aMsgDlgBtn, aMsgDlgBtnDef);

  with aMsgDialog do
    begin
      BringToFront;
           
      Caption := psCaption;
      ClientHeight := nHeigth;
      BorderIcons := []; // Keine Border-Icons
      BorderStyle := bsNone; // Keine Titelleiste
      FormStyle := fsStayOnTop;

      Top := (Screen.Height div 2) - (Height div 2);
      SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);

      Free;
    end;
end;

// Aufruf:
MsgBox('Caption', 'Text', 100, mtInformation, [mbYes, mbNo, mbClose], mbNo);
kannst du bitte dein project noch mal nachsehen, damit ich es mit delphi 7 auch öffnen kann.


gruss
  Mit Zitat antworten Zitat