Einzelnen Beitrag anzeigen

Benutzerbild von _frank_
_frank_

Registriert seit: 21. Feb 2003
Ort: Plauen / Bamberg
922 Beiträge
 
Delphi 3 Professional
 
#3

Re: TOpendialog Größe ändern

  Alt 19. Jun 2007, 15:14
ich schau mir grade mal den source von der Komponente "TSzOpenDialog" (http://www.torry.ru/pages.php?id=83) an. diese soll das resizing unterstützen (Funktioniert auch super ).

er setzt eine Konstante und erweitert die VCL-Options...
Delphi-Quellcode:
const
OFN_ENABLESIZING = $00800000;

  OpenOptions: array [TOpenOption] of DWORD = (
    OFN_READONLY, OFN_OVERWRITEPROMPT, OFN_HIDEREADONLY,
    OFN_NOCHANGEDIR, OFN_SHOWHELP, OFN_NOVALIDATE, OFN_ALLOWMULTISELECT,
    OFN_EXTENSIONDIFFERENT, OFN_PATHMUSTEXIST, OFN_FILEMUSTEXIST,
    OFN_CREATEPROMPT, OFN_SHAREAWARE, OFN_NOREADONLYRETURN,
    OFN_NOTESTFILECREATE, OFN_NONETWORKBUTTON, OFN_NOLONGNAMES,
    OFN_EXPLORER, OFN_NODEREFERENCELINKS,
    OFN_ENABLESIZING);

  TOpenOption = (ofReadOnly, ofOverwritePrompt, ofHideReadOnly,
    ofNoChangeDir, ofShowHelp, ofNoValidate, ofAllowMultiSelect,
    ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofCreatePrompt,
    ofShareAware, ofNoReadOnlyReturn, ofNoTestFileCreate, ofNoNetworkButton,
    ofNoLongNames, ofOldStyleDialog, ofNoDereferenceLinks, ofEnableSizing);
dieses weist er einem Flag (TOpenfilename.Flags, definiert in rtl\CommDlg.pas) zu.
Delphi-Quellcode:
  TOpenFilenameA = packed record
    ....
    Flags: DWORD;
Delphi-Quellcode:
  with OpenFilename do
  begin
    ...
    for Option := Low(Option) to High(Option) do
      if Option in FOptions then
        Flags := Flags or OpenOptions[Option];
Würde gerne vom normalen Dialog ableiten, komme aber vermutlich nicht mehr an das flag ran...

habs mal so probiert:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  DlgHwnd:Integer;
const
  OFN_ENABLESIZING = $00800000;
begin
  DlgHwnd:=GetParent(opendialog1.Handle); //auch ohne GetParent probiert
  SetWindowLong(DlgHwnd,GWL_STYLE,GetWindowLong(DlgHwnd,GWL_Style) or OFN_ENABLESIZING);
  opendialog1.execute;
end;
will ungern wegen dem resizing eine Fremdkomponente verwenden. der DFM-Editor soll eigentlich nur Standard-kompos verwenden...also wenn es da eine SetWindowLong- oder CreateParams-Variante gibt, wär mir sehr geholfen...ansonsten gibts halt kein resizing

Gruß Frank
  Mit Zitat antworten Zitat