VBScript SendKeys CTRL+LWIN+TAB?

前端 未结 4 1878
春和景丽
春和景丽 2020-12-19 09:13

I am trying to write a simple script that will send the key combo of CTRL+WINDOWS KEY+TAB. The code below sends the keys CTRL+

相关标签:
4条回答
  • 2020-12-19 09:45

    try this code:

    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.SendKeys "+(^{LWIN}{TAB})"
    
    0 讨论(0)
  • 2020-12-19 09:47

    Just in case someone land here on these years...
    A workaround (instead of sending keystrokes) is to call directly to the application:

    Set objShell = CreateObject("Shell.Application")
    objShell.WindowSwitcher
    

    This will open Task Switcher Windows App. (Same as ⊞ windows+TAB)

    0 讨论(0)
  • 2020-12-19 09:53

    I know you are looking for VBscript but it looks like that is unlikely (pure VBscript). Here is a post that did solve this via C#.

    https://stackoverflow.com/a/10367832/1742115

    This page tells how to call the C# DLL from your VBscript if you want to keep some of this in vbs.

    0 讨论(0)
  • 2020-12-19 10:08

    I think your question is an example of an XY problem and what you actually want to do is to activate Flip 3D (Switch between windows). You can do this programmatically by executing the rundll32 DwmApi #105 command:

    CreateObject("WScript.Shell").Run "rundll32 DwmApi #105"
    
    0 讨论(0)
提交回复
热议问题