在TShellTreeView里实现只显示目录的功能,就像“选择目录”对话框的目录树。TShellTreeView的根目录为桌面,显示包括隐藏目录在内的所有目录,但在桌面下不显示“Internet Explorer”,“回收站”等项,在各驱动器下,不显示“回收站”。总之,出来的结果就和“选择目录”对话框中的目录树显示的内容一致。直接调用SelectDirectory出来的是一个对话框,但我只想要一个TTreeView控件作为界面的一部分。我想用判断名字的方法来取消它们的显示,但在各个Windows平台下可能运行的结果不会相同,不知道各位高手有什么高招。
解决方案 »
- 本人现急需使用一个可以实现多选的控件,望高手指点!
- 请问inno怎么设置上一级目录呢?
- [紧急-紧急]Delphi中用dbExpress的SQLConnection组件可以连接SQl Server有问题!!
- 用quickreport如何实现工资条打印!!,急急急。。。
- 复制文件夹时报“无法复制文件:无法读源文件或磁盘”,为什么?怎么办?
- 如何生成这样的txt?
- 哪里有InstallShield Express Custom Edition for Delphi 下载?
- 初学者面对的一个有高难度的大问题,高手进来留个言啊
- 如何应用程序一直保持在最下层
- 不用ctrl+v,直接用右健可以实现在TRichText中粘贴输入吗?
- 200分求:《Delphi6企业级解决方案及应用剖析》电子书和光盘源程序!!!!
- 怎样实现SYBASE与SQL-SERVER的数据库同步?
但不知道怎么把SelectDirectory显示的TTreeView嵌到我的窗口上去呢?用findWindowEx把selectdirectory的handle找到
再用setParent这个api函数就可以了
The SetParent function changes the parent window of the specified child window. HWND SetParent( HWND hWndChild, // handle of window whose parent is changing
HWND hWndNewParent // handle of new parent window
);
ParametershWndChildIdentifies the child window. hWndNewParentIdentifies the new parent window. If this parameter is NULL, the desktop window becomes the new parent window. Return ValuesIf the function succeeds, the return value is the handle of the previous parent window.
If the function fails, the return value is NULL. To get extended error information, call GetLastError. ResAn application can use the SetParent function to set the parent window of a pop-up, overlapped, or child window. The new parent window and the child window must belong to the same application.
If the window identified by the hWndChild parameter is visible, Windows performs the appropriate redrawing and repainting.