2019年2月27日 星期三

多螢幕工具

目前辦公室有三顆螢幕,有時候會有突然找不到游標,或是有時候想將游標鎖定在固定的視窗當中
Dual Monitor tools 可以做到,並且在可以設定按快捷鍵切解除鎖定
可惜的是他沒有將視窗開起在游標位置,要另外找程式
目前可以用AutoHotKey做到

Code下載

#Persistent
SetBatchLines, -1
Process, Priority,, High

Gui +LastFound
hWnd := WinExist()

DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return

ShellMessage( wParam,lParam ) {

  If ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
{
WinGetTitle, Title2, A

; Activate top window
WinActivate, %Title2%

; This un-maximizes fullscreen things to prevent UI bug.
WinRestore, %Title2%
; Mouse screen coords = mouse relative + win coords therefore..
WinGetPos, xtemp, ytemp,,, A ; get active windows location
MouseGetPos, X, Y   ; get mouse location

;; Calculate actual position
;; -16 on x and y pos allows you to doubleclick and close window(most of the time)
xpos:=temp-16
ypos:=temp-16

WinMove, %Title2%, , %xpos%, %ypos%  ; move window to mouse
     }
}

沒有留言:

張貼留言