AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / computer / Perguntas / 1457314
Accepted
Krzysztof Bociurko
Krzysztof Bociurko
Asked: 2019-07-09 02:28:37 +0800 CST2019-07-09 02:28:37 +0800 CST 2019-07-09 02:28:37 +0800 CST

Alterne entre janelas em apenas uma área de trabalho virtual com Autohotkey - com alt+tab funcionando como está

  • 772

Estou procurando uma função de tecla de atalho automática, atalho do sistema ou chamada de dll para alternar entre todas as janelas na área de trabalho virtual atual.

O Windows 10 tem essa opção ( pressionar Alt+Tab mostra as janelas abertas apenas na área de trabalho que estou usando ), mas essa é uma configuração global que afetará o uso normal de alt+tab. Eu quero manter isso como switch multi-desktop.

windows-10 autohotkey
  • 1 1 respostas
  • 310 Views

1 respostas

  • Voted
  1. Best Answer
    user3419297
    2019-07-09T05:52:26+08:002019-07-09T05:52:26+08:00

    Tente isto:

    F1:: WinMenuOnCurrentVirtualDesktop()
    
    WinMenuOnCurrentVirtualDesktop(){
        list := ""
        Menu, windows, Add
        Menu, windows, deleteAll
        WinGet, id, list
        Loop, %id%
        {
            this_ID := id%A_Index%
            WinGetTitle, title, ahk_id %this_ID%
            If (title = "")
                continue            
            If !IsWindow(WinExist("ahk_id" . this_ID))
                continue
            If !IsWindowOnCurrentVirtualDesktop(this_ID)
                continue
            Menu, windows, Add, %title%, ActivateTitle      
            WinGet, Path, ProcessPath, ahk_id %this_ID%
            Try 
                Menu, windows, Icon, %title%, %Path%,, 0
            Catch 
                Menu, windows, Icon, %title%, %A_WinDir%\System32\SHELL32.dll, 3, 0 
        }
        CoordMode, Mouse, Screen
        MouseMove, (0.4*A_ScreenWidth), (0.35*A_ScreenHeight)
        CoordMode, Menu, Screen
        Xm := (0.25*A_ScreenWidth)
        Ym := (0.25*A_ScreenHeight)
        Menu, windows, Show, %Xm%, %Ym%
    }
    
    ActivateTitle:
        SetTitleMatchMode 3
        WinActivate, %A_ThisMenuItem%
    return
    
    ;-----------------------------------------------------------------
    ; Check whether the target window is activation target
    ;-----------------------------------------------------------------
    
    IsWindow(hwnd) {
        WinGet, s, Style, ahk_id %hwnd% 
        return s & 0xC00000 ? (s & 0x100 ? 0 : 1) : 0
    } 
    
    /* 
    IsWindow(hWnd){
        WinGet, dwStyle, Style, ahk_id %hWnd%
        if ((dwStyle&0x08000000) || !(dwStyle&0x10000000)) {
            return false
        }
        WinGet, dwExStyle, ExStyle, ahk_id %hWnd%
        if (dwExStyle & 0x00000080) {
            return false
        }
        WinGetClass, szClass, ahk_id %hWnd%
        if (szClass = "TApplication") {
            return false
        }
        return true
    }
    */
    
    
    ;--------------------------------------------------------------------------------
    ;Indicates whether the provided window is on the currently active virtual desktop.
    ;https://autohotkey.com/boards/viewtopic.php?p=64295#p64295
    ;--------------------------------------------------------------------------------
    IsWindowOnCurrentVirtualDesktop(hWnd) {
        onCurrentDesktop := ""
        CLSID := "{aa509086-5ca9-4c25-8f95-589d3c07b48a}" 
        IID := "{a5cd92ff-29be-454c-8d04-d82879fb3f1b}"
        IVirtualDesktopManager := ComObjCreate(CLSID, IID)  
        Error := DllCall(NumGet(NumGet(IVirtualDesktopManager+0), 3*A_PtrSize), "Ptr", IVirtualDesktopManager, "Ptr", hWnd, "IntP", onCurrentDesktop)
        ObjRelease(IVirtualDesktopManager)  
        if !(Error=0)
            return false, ErrorLevel := true
        return onCurrentDesktop, ErrorLevel := false
    }
    

    EDITAR:

    Tente também

    F1:: WinMenuOnCurrentVirtualDesktop()
    
    WinMenuOnCurrentVirtualDesktop(){
        Menu, Windows, Add
        Menu, Windows, deleteAll
        WinGet, id, list
        Loop %id%
        {
            this_ID := id%A_Index%
            WinGetTitle title, ahk_id %this_ID%
            If (title = "")
                continue
            ; If (title = "this title") ; add exceptions
                ; continue
            If !IsWindow(WinExist("ahk_id" . this_ID))
                continue
            If !IsWindowOnCurrentVirtualDesktop(WinExist("ahk_id" . this_ID))
                continue
            WinGetClass class, ahk_id %this_ID%
            ; If (class = "this class") ; add exceptions
                ; continue
            If (class = "ApplicationFrameWindow") 
            {
                WinGetText, text, ahk_id %this_ID%      
                If (text = "")
                {
                    WinGet, style, style, ahk_id %this_ID%
                    If !(style = "0xB4CF0000")   ; the window isn't minimized
                        continue
                }
            }
            WinGet, Path, ProcessPath, ahk_id %this_ID%
            Menu, Windows, Add, %title%, Activate_Window
            Try 
                Menu, Windows, Icon, %title%, %Path%,, 0
            Catch
                Menu, Windows, Icon, %title%, %A_WinDir%\System32\SHELL32.dll, 3, 0
        }
        CoordMode, Mouse, Screen
        MouseMove, (0.4*A_ScreenWidth), (0.35*A_ScreenHeight)
        CoordMode, Menu, Screen
        Xm := (0.25*A_ScreenWidth)
        Ym := (0.25*A_ScreenHeight)
        Menu, windows, Show, %Xm%, %Ym%
    }
    
    Activate_Window:
        SetTitleMatchMode, 3
        WinGetClass, Class, %A_ThisMenuItem%
        If (Class="Windows.UI.Core.CoreWindow") ; the minimized window has another class 
            WinActivate, %A_ThisMenuItem% ahk_class ApplicationFrameWindow
        else
            WinActivate, %A_ThisMenuItem%
    return
    
    ;-----------------------------------------------------------------
    ; Check whether the target window is activation target
    ;-----------------------------------------------------------------
    
    IsWindow(hwnd) {
        WinGet, s, Style, ahk_id %hwnd% 
        return s & 0xC00000 ? (s & 0x100 ? 0 : 1) : 0
    } 
    
    
    ;--------------------------------------------------------------------------------
    ;Indicates whether the provided window is on the currently active virtual desktop.
    ;https://autohotkey.com/boards/viewtopic.php?p=64295#p64295
    ;--------------------------------------------------------------------------------
    IsWindowOnCurrentVirtualDesktop(hWnd) {
        onCurrentDesktop := ""
        CLSID := "{aa509086-5ca9-4c25-8f95-589d3c07b48a}" 
        IID := "{a5cd92ff-29be-454c-8d04-d82879fb3f1b}"
        IVirtualDesktopManager := ComObjCreate(CLSID, IID)  
        Error := DllCall(NumGet(NumGet(IVirtualDesktopManager+0), 3*A_PtrSize), "Ptr", IVirtualDesktopManager, "Ptr", hWnd, "IntP", onCurrentDesktop)
        ObjRelease(IVirtualDesktopManager)  
        if !(Error=0)
            return false, ErrorLevel := true
        return onCurrentDesktop, ErrorLevel := false
    }
    
    • 1

relate perguntas

  • O serviço de arbitragem USB da estação de trabalho VMware não inicia automaticamente

  • Como ativar o sensor de impressão digital no domínio e no diretório ativo do Linux

  • atalho do shell da área de trabalho no painel lateral do explorer

  • Por que não consigo enviar arquivos do Android para o Windows 10?

  • Abrir com em vários arquivos?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    O visualizador de fotos do Windows não pode ser executado porque não há memória suficiente?

    • 5 respostas
  • Marko Smith

    Como faço para ativar o WindowsXP agora que o suporte acabou?

    • 6 respostas
  • Marko Smith

    Área de trabalho remota congelando intermitentemente

    • 7 respostas
  • Marko Smith

    Serviço do Windows 10 chamado AarSvc_70f961. O que é e como posso desativá-lo?

    • 2 respostas
  • Marko Smith

    O que significa ter uma máscara de sub-rede /32?

    • 6 respostas
  • Marko Smith

    Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows?

    • 1 respostas
  • Marko Smith

    O VirtualBox falha ao iniciar com VERR_NEM_VM_CREATE_FAILED

    • 8 respostas
  • Marko Smith

    Os aplicativos não aparecem nas configurações de privacidade da câmera e do microfone no MacBook

    • 5 respostas
  • Marko Smith

    ssl.SSLCertVerificationError: falha na verificação do certificado [SSL: CERTIFICATE_VERIFY_FAILED]: não foi possível obter o certificado do emissor local (_ssl.c:1056)

    • 4 respostas
  • Marko Smith

    Como posso saber em qual unidade o Windows está instalado?

    • 6 respostas
  • Martin Hope
    Albin Como faço para ativar o WindowsXP agora que o suporte acabou? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 O "HTTPS Everywhere" ainda é relevante? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch O Windows 10 exclui muitos arquivos minúsculos muito lentamente. Algo pode ser feito para agilizar? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 Área de trabalho remota congelando intermitentemente 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney Por que colocar um ponto após o URL remove as informações de login? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Como Ctrl+C e Ctrl+V funcionam? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca Todos os meus complementos do Firefox foram desativados repentinamente, como posso reativá-los? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK É possível criar um código QR usando texto? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 Altere o nome da ramificação padrão do git init 2019-04-01 06:16:56 +0800 CST

Hot tag

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve