使用selectdirectory('选择文件夹','',s)打开选择文件夹对话框,怎么使对话框居中显示? 一种 自已重做一种 找到窗口的Handle再改变位置 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 函数本身没有提供控制位置的参数,只有到vcl源代码中去找了,或者直接用shbrowserfolder这个api函数了 function SelectDirectory(handle:hwnd;const Caption: string; const Root: WideString;out Directory: string): Boolean;varlpbi:_browseinfo;buf:array [0..MAX_PATH] of char;id:ishellfolder;eaten,att:cardinal;rt:pitemidlist;initdir:pwidechar;beginresult:=false;lpbi.hwndOwner:=handle;lpbi.lpfn:=nil;lpbi.lpszTitle:=pchar(caption);lpbi.ulFlags:=BIF_RETURNONLYFSDIRS+16;SHGetDesktopFolder(id);initdir:=pwchar(root);id.ParseDisplayName(0,nil,initdir,eaten,rt,att);lpbi.pidlRoot:=rt;getmem(lpbi.pszDisplayName,MAX_PATH);tryresult:=shgetpathfromidlist(shbrowseforfolder(lpbi),buf);exceptfreemem(lpbi.pszDisplayName);end;if result then directory:=buf;end;必须uses ShellApi; 40Star(陪你去看--☆流星雨★) :不是uses ShellAPI,是ShlObj 用过Kingron写的这个函数,当时就因为没有找到这个单元无法编译。 请教如何防止ACCESS的数据自动恢复 如何取出TADOQuery中的记录 windows2003如何设置或者编程实现定时用户注销 两个表是怎样的关系才能称为主细表? 能不能用qreport做出这样的表格 怎样把多副BMP转换为动态的GIF,在线急等,谢谢各位大侠了 会者不难,进来看看这个问题! 有关combobox 我都要崩溃了! 寻找,帮忙! windows 2000的小问题 关于日期计算的问题!
或者直接用shbrowserfolder这个api函数了
var
lpbi:_browseinfo;
buf:array [0..MAX_PATH] of char;
id:ishellfolder;
eaten,att:cardinal;
rt:pitemidlist;
initdir:pwidechar;
begin
result:=false;
lpbi.hwndOwner:=handle;
lpbi.lpfn:=nil;
lpbi.lpszTitle:=pchar(caption);
lpbi.ulFlags:=BIF_RETURNONLYFSDIRS+16;
SHGetDesktopFolder(id);
initdir:=pwchar(root);
id.ParseDisplayName(0,nil,initdir,eaten,rt,att);
lpbi.pidlRoot:=rt;
getmem(lpbi.pszDisplayName,MAX_PATH);
try
result:=shgetpathfromidlist(shbrowseforfolder(lpbi),buf);
except
freemem(lpbi.pszDisplayName);
end;
if result then directory:=buf;
end;
必须
uses ShellApi;
不是uses ShellAPI,是ShlObj
用过Kingron写的这个函数,当时就因为没有找到这个单元无法编译。