如何在Windows Vista及更高版本上进入Windows Flip 3D模式?

TLa*_*ama 13 windows delphi winapi desktop windows-shell

是否有可能以Flip 3D mode编程方式触发Windows Vista上面的系统?

在此输入图像描述

这与手动按CTRL+ WIN+相同TAB

TLa*_*ama 18

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;
Run Code Online (Sandbox Code Playgroud)


更新:

或者正如Norbert Willhelm在这里提到的,还有IShellDispatch5对象接口实际上引入了该WindowSwitcher方法.所以这是同一个版本的另一个版本......

下面这段代码需要Shell32_TLB.pas单元,你可以在Delphi中创建这种方式(注意,你必须至少拥有IShellDispatch5第一次使用该接口的Windows Vista ):

  • 转到菜单组件/导入组件
  • 继续选择导入类型库
  • 选择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;
Run Code Online (Sandbox Code Playgroud)

  • 还有IShellDispatch5. (4认同)