Como permitir que um script de atalho automático sobreviva ao bloqueio de área de trabalho?

1

Eu tenho um script Auto-Hotkey

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Recommended for catching common errors.
SendMode Event  ; Input worked hardly, "Event" is better.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 1 ; 1: A window's title must start with the specified WinTitle to be a match.

#IfWinActive Zooming Viewer
~RButton & WheelDown::
    Send {Ctrl Down} {WheelUp} {Ctrl Up}
    return
~RButton & WheelUp::
    Send {Ctrl Down} {WheelDown} {Ctrl Up}
    return

Ref .: Como faço o Auto Hotkey converter" RButton para baixo, ação Mousewheel, RButton para cima "em" MButton para baixo, Mouse movendo para cima e para baixo, MButton para cima ""

Como faço para que esse script sobreviva ao bloqueio de área de trabalho no Win-7? Depois de liberar o computador bloqueado, o visualizador se comporta como sem o script AHK. Clicando no menu de script na área de notificação, escolhendo "Recarregar este Script" faz com que funcione novamente - mas forçado a fazê-lo parece um pouco chato.

    
por Peter 29.08.2018 / 15:42

1 resposta

0

Tente

#Warn  ; Recommended for catching common errors.
SendMode Event  ; Input worked hardly, "Event" is better.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetTitleMatchMode, 1 ; 1: A window's title must start with the specified WinTitle to be a match.

MsgBox, Reloading

OnMessage(0x2b1,"WM_WTSSESSION_CHANGE")
Gui,+LastFound
hwnd:=WinExist()
DllCall("Wtsapi32.dll\WTSRegisterSessionNotification","UInt",hwnd,"UInt",0)
    Return


#IfWinActive Zooming Viewer

    ~RButton & WheelDown::
        Send {Ctrl Down} {WheelUp} {Ctrl Up}
        return
    ~RButton & WheelUp::
        Send {Ctrl Down} {WheelDown} {Ctrl Up}
        return

#IfWinActive

WM_WTSSESSION_CHANGE(wParam,lParam){
    static _0x1:="WTS_CONSOLE_CONNECT" ;A session was connected to the console terminal.
    ; ,_0x2:="WTS_CONSOLE_DISCONNECT" ;A session was disconnected from the console terminal.
    ; ,_0x3:="WTS_REMOTE_CONNECT" ;A session was connected to the remote terminal.
    ; ,_0x4:="WTS_REMOTE_DISCONNECT" ;A session was disconnected from the remote terminal.
    ,_0x5:="WTS_SESSION_LOGON" ;A user has logged on to the session.
    ; ,_0x6:="WTS_SESSION_LOGOFF" ;A user has logged off the session.
    ; ,_0x7:="WTS_SESSION_LOCK" ;A session has been locked.
    ,_0x8:="WTS_SESSION_UNLOCK" ;A session has been unlocked.
    ; ,_0x9:="WTS_SESSION_REMOTE_CONTROL" ;A session has changed its remote controlled status. To determine the status, call GetSystemMetrics and check the SM_REMOTECONTROL metric.
    Reload
}

link

    
por 30.08.2018 / 09:26