1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| function BrowseCallback(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM): Integer stdcall;
var wa, rect : TRect;
dialogPT : TPoint;
begin
Result := 0;
if uMsg = BFFM_INITIALIZED
then
begin
with TBrowseDialog(lpData) do
begin
SendMessage(Wnd, BFFM_SETSTATUSTEXT, 1, Longint(PChar(Folder)));
if Length(Folder) > 0
then SendMessage(Wnd, BFFM_SetSelection, 1, Longint(PChar(Folder)));
end;
// centrer
wa := Screen.ActiveForm.BoundsRect;
GetWindowRect(Wnd, Rect);
dialogPT.X := ((wa.Right-wa.Left) div 2) -
((rect.Right-rect.Left) div 2);
dialogPT.Y := ((wa.Bottom-wa.Top) div 2) -
((rect.Bottom-rect.Top) div 2);
MoveWindow(Wnd,
wa.Left + dialogPT.X,
wa.Top + dialogPT.Y,
Rect.Right - Rect.Left,
Rect.Bottom - Rect.Top,
True);
end;
end; |
Partager