Einzelnen Beitrag anzeigen

dGeek
(Gast)

n/a Beiträge
 
#10

AW: Titelleiste / Rahmen der MessageDlg ausblenden

  Alt 1. Dez 2014, 15:21
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);
Angehängte Dateien
Dateityp: zip Custom Message Dialog.zip (701,0 KB, 16x aufgerufen)

Geändert von dGeek ( 1. Dez 2014 um 15:32 Uhr)
  Mit Zitat antworten Zitat