Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Dialogue FileOpen position chose
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Operator not Overloaded E...
by
TRon
[
Today
at 06:46:51 am]
Poor optimization of cons...
by
circular
[
Today
at 05:46:03 am]
Passing TDate parameter i...
by
Arskin_Fertrubble
[
Today
at 03:54:53 am]
Notarization under macOS ...
by
TRon
[
Today
at 03:52:46 am]
Class method inheritance ...
by
Kraig
[
Today
at 03:36:30 am]
“case (a,b) of...” doesn’...
by
Warfley
[
Today
at 12:42:19 am]
[SOLVED] Components with ...
by
PascalDragon
[September 28, 2023, 10:56:29 pm]
Proposal: Record Composit...
by
PascalDragon
[September 28, 2023, 10:09:08 pm]
[solved] Confusing scope(...
by
PascalDragon
[September 28, 2023, 10:07:39 pm]
Help explain this closure...
by
PascalDragon
[September 28, 2023, 09:53:07 pm]
c++ library and strings
by
PascalDragon
[September 28, 2023, 09:42:40 pm]
Is it possible to jump in...
by
PascalDragon
[September 28, 2023, 09:31:58 pm]
is there a way to Forward...
by
PascalDragon
[September 28, 2023, 09:27:32 pm]
Can't hide main window
by
Aqdam1978@yahoo.com
[September 28, 2023, 09:07:34 pm]
Make visual components no...
by
pleumann
[September 28, 2023, 08:20:01 pm]
Saving a Form state (rela...
by
Curt Carpenter
[September 28, 2023, 08:10:45 pm]
TDbf
by
1HuntnMan
[September 28, 2023, 07:37:26 pm]
PV_Unpacker for ZIP, RAR,...
by
domasz
[September 28, 2023, 07:00:37 pm]
Searchkey Tdbf
by
rcmz
[September 28, 2023, 06:57:45 pm]
Debugger crashes with App...
by
geraldholdsworth
[September 28, 2023, 03:51:37 pm]
Scrolling TStringGrid
by
big_M
[September 28, 2023, 02:48:43 pm]
Large system, i2C to go w...
by
pascalbythree
[September 28, 2023, 02:47:33 pm]
TMemo text width
by
wp
[September 28, 2023, 12:50:05 pm]
Cannot get file opening e...
by
ranny
[September 28, 2023, 08:45:56 am]
FPC 3.2.2 / Lazarus 2.2.6...
by
robert rozee
[September 28, 2023, 01:31:18 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Dialogue FileOpen position chose (Read 465 times)
marcio2003
Jr. Member
Posts: 68
Dialogue FileOpen position chose
«
on:
May 25, 2023, 11:02:40 am »
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.
Logged
Lazarus 2.0.10 Windows 10 64bits
ASerge
Hero Member
Posts: 2104
Re: Dialogue FileOpen position chose
«
Reply #1 on:
May 25, 2023, 06:33:08 pm »
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.
Code: Pascal
[Select]
[+]
[-]
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
.
Logged
marcio2003
Jr. Member
Posts: 68
Re: Dialogue FileOpen position chose
«
Reply #2 on:
May 29, 2023, 12:23:17 pm »
Hi,
Thank you for your tips!
I'll try to use them to solve my problems.
Logged
Lazarus 2.0.10 Windows 10 64bits
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Dialogue FileOpen position chose
TinyPortal
© 2005-2018