procedure TUploadForm.OpenDlgOnShow(Sender: TObject);
var
hParent: THandle;
rect: TRect;
hChkBox1: THandle;
hChkBox2: THandle;
begin
hParent := GetParent(OpenDialog.Handle);
GetWindowRect(hParent, rect);
SetWindowPos(hParent, 0, 0, 0, rect.Right - rect.Left, rect.Bottom - rect.Top
+ 50, SWP_NOMOVE);
hChkBox1 := CreateWindowEx(0, '
BUTTON', '
Beschriftung BOX1', WS_CHILD
or WS_VISIBLE
or BS_AUTOCHECKBOX,
195, rect.Bottom - rect.Top - 27, 265, 20, hParent, 101, 0,
nil);
hChkBox2 := CreateWindowEx(0, '
BUTTON', '
Beschriftung BOX2', WS_CHILD
or WS_VISIBLE
or BS_AUTOCHECKBOX,
195, rect.Bottom - rect.Top - 2, 265, 20, hParent, 102, 0,
nil);
if hChkBox1 = 0
then RaiseLastOSError;
if hChkBox2 = 0
then RaiseLastOSError;
end;
procedure TUploadForm.OpenDlgOnClose(Sender: TObject);
var hParent: THandle;
hChkBox1: THandle;
hChkBox2: THandle;
begin
hParent := GetParent(OpenDialog.Handle);
// get handle of checkboxes
hChkBox1 := GetDlgItem(hParent, 101);
hChkBox2 := GetDlgItem(hParent, 102);
end;
procedure TUploadForm.Button2Click(Sender: TObject);
begin
OpenDialog.OnShow := OpenDlgOnShow;
OpenDialog.OnClose := OpenDlgOnClose;
OpenDialog.Execute();
end;