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 ):
和代码:
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)