Hi folks,
  Has anyone any pointers for manipulating TOpenDialog for better 
or different behaviour?  (I'm using D4).

For example, a client wants us to have the dialog open LARGER, 
with "DETAILED" file listings by default, and also RESIZABLE. The 
latter should be attainable via the Options.ofEnableSizing property 
but, in fact, it seems to have no effect -- in fact, nothing in the 
dialogs.pas code uses it, other than the set its property value...  

As for the other two features requested, it is clear that 
TOpenDialog/TCommonDialog are encapsulating some kind of 
Explorer-style window, but I cannot see a way to manipulate the 
standard sizing and default settings used by that window. For 
example, I tried calling the function below in the DoShow event of 
an inherited dialog object, but it had no effect (it's supposed to 
make the window twice as high as its initial creation size).

If anyone has been down this route before and can suggest a way 
to manipulate what we need without a full TOpenDialog rewrite, I'd 
greatly appreciate it.  I hope it's something obvious I've missed <g>.

procedure EnlargeWindow(Wnd: HWnd);
var
  Rect: TRect;
  Monitor: TMonitor;
begin
  GetWindowRect(Wnd, Rect);
  if Application.MainForm <> nil then
    Monitor := Application.MainForm.Monitor
  else
    Monitor := Screen.Monitors[0];
  SetWindowPos(Wnd, 0,
    Monitor.Left + ((Monitor.Width - Rect.Right + Rect.Left) div 2),
    Monitor.Top + ((Monitor.Height - Rect.Bottom + Rect.Top) div 3),
    Rect.right-Rect.left, (Rect.Bottom-Rect.Top)*2, 
SWP_NOACTIVATE or SWP_NOZORDER);
end;


Clues welcomed!
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to