Форум: "KOL";
Текущий архив: 2007.06.10;
Скачать: [xml.tar.bz2];
ВнизVista OpenSaveDialog Найти похожие ветки
← →
Thaddy (2006-10-20 16:02) [0]Here"s another Vista thing:
function OpenSaveFileDialog(Parent: PControl; const DefExt, Filter, InitialDir, Title: string; var FileName: string;
MustExist, OverwritePrompt, NoChangeDir, DoOpen: Boolean): Boolean;
var
ofn: TOpenFileName;
szFile: array[0..MAX_PATH] of Char;
tmp: string;
begin
Result := False;
if Winver > WvXP then
begin
FillChar(ofn, SizeOf(TOpenFileName), 0);
with ofn do
begin
lStructSize := SizeOf(TOpenFileName);
hwndOwner := Parent.Handle;
lpstrFile := szFile;
nMaxFile := SizeOf(szFile);
if (Title <> "") then
lpstrTitle := PChar(Title);
if (InitialDir <> "") then
lpstrInitialDir := PChar(InitialDir);
StrPCopy(lpstrFile, FileName);
tmp := Filter;
while strreplace(tmp, "|", #0) do
; //nothing but replace
lpstrFilter := PChar(tmp + #0#0);
if DefExt <> "" then
lpstrDefExt := PChar(DefExt);
end;
if MustExist then
ofn.Flags := ofn.Flags or OFN_FILEMUSTEXIST;
if OverwritePrompt then
ofn.Flags := ofn.Flags or OFN_OVERWRITEPROMPT;
if NoChangeDir then
ofn.Flags := ofn.Flags or OFN_NOCHANGEDIR;
if DoOpen then
begin
if GetOpenFileName(ofn) then
begin
Result := True;
FileName := szFile;
end;
end
else
begin
if GetSaveFileName(ofn) then
begin
Result := True;
FileName := szFile;
end;
end;
end;
end;
</code
← →
MTsv DN © (2006-10-21 09:25) [1]> Here"s another Vista thing
Works fine :)
P.S. Only was error "Unknown identefier" in the line "ofn: TOpenFileName;"... I wrote "uses CommDlg"...and that"s all...
P.P.S. I don"t know why the definition "TOpenFileName" in KOL.PAS not determing...
← →
Thaddy (2006-10-23 10:25) [2]Because kol.pas references commdlg for OpenSaveDialog :)
Страницы: 1 вся ветка
Форум: "KOL";
Текущий архив: 2007.06.10;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.054 c