可以通过编程方式在
Windows Vista以上的系统上触发
Flip 3D mode吗?
它与您手动按CTRL WIN TAB一样
Shell对象具有可以调用此模式的
WindowSwitcher方法.
这里是Delphi的代码示例:
uses
ComObj;
procedure EnterWindowSwitcherMode;
var
Shell: OleVariant;
begin
try
Shell := CreateOleObject('Shell.Application');
Shell.WindowSwitcher;
finally
Shell := Unassigned;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Win32MajorVersion >= 6 then // are we at least on Windows Vista ?
begin
try
EnterWindowSwitcherMode;
except
on E: Exception do
ShowMessage(E.ClassName + ': ' + E.Message);
end;
end;
end;
更新:
或者在这里提到的Norbert Willhelm,还有IShellDispatch5对象接口,实际上引入了WindowSwitcher方法.所以这里是另一个版本的相同…
以下代码需要Shell32_TLB.pas单元,您可以在Delphi中创建这样的方式(请注意,您必须至少具有第一次使用IShellDispatch5界面的Windows Vista):
>转到菜单Component / Import Component
>继续选择导入类型库
>选择Microsoft Shell控件和自动化并完成向导
和代码:
uses
Shell32_TLB;
procedure EnterWindowSwitcherMode;
var
// on Windows Vista and Windows 7 (at this time :)
// is Shell declared as IShellDispatch5 object interface
AShell: Shell;
begin
try
AShell := CoShell.Create;
AShell.WindowSwitcher;
finally
AShell := nil;
end;
end;