在新的Win2K的外壳(Shell)中如何实现全部最小化(MinimizeAll)功能

I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
在新的Win2K的外壳(Shell)中如何实现全部最小化(MinimizeAll)功能?
 
回答:
我发现如果你导入Microsoft Shell Controls & Automation Type Library,你可以在一个构件中得到这些功能。
 
在菜单上选择Project..Import Type Library...
 
选择 Microsoft Shell Controls & Automation (version 1.0).
 
点击 Install...
 
这里会有几个构件被安装到ActiveX构件栏。拖一个TShell构件到你的窗体或者DM上,你就可以使用以下代码实现全部最小化的功能:
 
Shell1.MinimizeAll;
 
/*********************************************************************
这里还有许多真正cool的Shell技巧在TShell构件中
*********************************************************************/
procedure TForm1.Shell(sMethod: Integer);
begin
case sMethod of
0:
//最小化桌面上所有的窗口
begin
Shell1.MinimizeAll;
Button1.Tag := Button1.Tag + 1;
end;
1:
//显示运行对话框
begin
Shell1.FileRun;
Button1.Tag := Button1.Tag + 1;
end;
2:
//显示关闭Windows对话框
begin
Shell1.ShutdownWindows;
Button1.Tag := Button1.Tag + 1;
end;
3:
//显示搜索对话框
begin
Shell1.FindFiles;
Button1.Tag := Button1.Tag + 1;
end;
4:
//显示日期/时间对话框
begin
Shell1.SetTime;
Button1.Tag := Button1.Tag + 1;
end;
5:
//显示Internet属性对话框
begin
Shell1.ControlPanelItem('INETCPL.cpl');
Button1.Tag := Button1.Tag + 1;
end;
6:
//让用户选择“程序”的存放路径
begin
Shell1.BrowseForFolder(0, 'My Programs', 0, 'C:Files');
Button1.Tag := Button1.Tag + 1;
end;
7:
//显示工具栏属性对话框
begin
Shell1.TrayProperties;
Button1.Tag := Button1.Tag + 1;
end;
8:
//恢复桌面上所有的窗口(全部最小化的逆操作)
begin
Shell1.UndoMinimizeAll;
Button1.Tag := 0;
end;
end; {case}
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
Shell(Button1.Tag);
end;
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
574
import
I
顶部