Forum > General

Dialogue FileOpen position chose

(1/1)

marcio2003:
Hi,
How i can chose position to FileOpen dialogue on Windows 10 using Lazarus_2_0_10.
Always I want it positioned in desktop center.
Thanks.

ASerge:

--- Quote from: marcio2003 on May 25, 2023, 11:02:40 am ---How i can chose position to FileOpen dialogue on Windows 10 using Lazarus_2_0_10.

--- End quote ---

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Dialogs, StdCtrls, ExtCtrls; type  TForm1 = class(TForm)    Button1: TButton;    OpenDialog1: TOpenDialog;    Timer1: TTimer;    procedure Button1Click(Sender: TObject);    procedure FormCreate(Sender: TObject);    procedure Timer1Timer(Sender: TObject);  private  public   end; var  Form1: TForm1; implementation {$R *.lfm} uses Windows; procedure TForm1.Button1Click(Sender: TObject);begin  Timer1.Enabled := True;  OpenDialog1.Execute;end; procedure TForm1.FormCreate(Sender: TObject);begin  Timer1.Enabled := False;  Timer1.Interval := 50;end; procedure TForm1.Timer1Timer(Sender: TObject);const  CDialogClass = '#32770';var  Wnd: HWND;begin  Wnd := FindWindow(CDialogClass, nil);  if (Wnd <> 0) and IsWindowVisible(Wnd) then  begin    Timer1.Enabled := False;    SetWindowPos(Wnd, 0, 33, 33, 0, 0, SWP_NOSIZE);  end;end; end.

marcio2003:
Hi,
Thank you for your tips!
I'll try to use them to solve my problems.

Navigation

[0] Message Index

Go to full version