사용 된 언어에 신경 쓰지 않기 때문에 AutoHotkey 스크립트에서이 작업에 약간의 행운을 보았습니다. 그것은 시뮬레이션 된 키 입력과 마우스 움직임을 사용하여 작업 표시 줄을 이동합니다. 나는 자동으로 작업 표시 줄 잠금을 해제/잠그지 못했습니다.
어려운 부분이 안정적으로 작동하도록하고있었습니다. 많은 코드는 작업 표시 줄이 움직 였는지 확인하는 데 전념합니다. 그것은 여전히 100 % 작동하지 않습니다 ... 그것은 내가 본 것의 시간의 10 %처럼 실패합니다. 그러나, 당신을 시작하게 충분히 좋을 것입니다!
완벽하게 작동하도록이 스크립트로 돌아온 경우 여기에서 다시 게시 해 보겠습니다. 다음은이 사용 AutoHotkey에 스크립트를 할 나의 포획이다 나는 또한 윈도우 7에서이 필요가
F3::
reload
return
F5::
MoveTaskbar(2,"bottom")
return
F6::
MoveTaskbar(2,"left")
return
F7::
MoveTaskbar(1,"top")
return
; Move the taskbar
; dspNumber: number. device number (primary display is 1, secondary display is 2...)
; edge: string. Top, Right, Bottom, or Left
MoveTaskbar(dspNumber, edge)
{
Critical
OutputDebug MoveTaskbar - called to move taskbar to display #%dspNumber% ("%edge%" edge)
; absolute coordinate system
CoordMode, Mouse, Screen
; error checking for dspNumber
SysGet, numMonitors, MonitorCount
if (numMonitors<dspNumber)
{
OutputDebug MoveTaskbar - [ERROR] target monitor does not exist (dspNumber = "%dspNumber%")
return
}
; get screen position for target monitor
SysGet, target, Monitor, %dspNumber%
oX := 7
oY := 7
; get coordinates for where to move the taskbar
if (edge = "Top")
{
oX := (targetRight-targetLeft)/2
trgX := oX+targetLeft
trgY := targetTop+15
}
else if (edge = "Right")
{
oY := -(targetBottom-targetTop)/2
trgX := targetRight-15
trgY := -oY + targetTop
}
else if (edge = "Bottom")
{
oX := -(targetRight-targetLeft)/2
trgX := -oX+targetLeft
trgY := targetBottom-15
}
else if (edge = "Left")
{
oY := (targetBottom-targetTop)/2
trgX := targetLeft+15
trgY := oY+targetTop
}
else
{
OutputDebug MoveTaskbar - [ERROR] target edge was improperly specified (edge = "%edge%")
return
}
trgX := round(trgX)
trgY := round(trgY)
oX := round(oX)
oY := round(oY)
OutputDebug MoveTaskbar - target location is (%trgX%,%trgY%)
MouseGetPos, startX, startY
OutputDebug MoveTaskbar - mouse is currently at (%startX%,%startY%)
; request the move mode (via context menu)
SendInput #b
SendInput !+{Space}
SendInput m
; wait for the move mode to be ready
Loop
{
if A_Cursor = SizeAll
break
}
OutputDebug MoveTaskbar - move mode is ready
; start the move mode
SendInput {Right}
; wait for the move mode to become active for mouse control
Loop
{
if A_Cursor = Arrow
break
}
OutputDebug MoveTaskbar - move mode is active for mouse control
; move taskbar (and making sure it actually does move)
offset := 7
count := 0
Loop
{
; move the taskbar to the desired location
OutputDebug MoveTaskbar - attempting to move mouse to (%trgX%,%trgY%)
MouseMove, %trgX%, %trgY%, 0
MouseGetPos, mX, mY, win_id
WinGetClass, win_class, ahk_id %win_id%
count += 1
; if the mouse didn't get where it was supposed to, try again
If ((mX != trgX) or (mY != trgY))
{
OutputDebug MoveTaskbar - mouse didn't get to its destination (currently at (%mX%,%mY%)). Trying the move again...
continue
}
; if the taskbar hasn't followed yet, wiggle the mouse!
if (win_class != "Shell_TrayWnd")
{
OutputDebug MoveTaskbar - window with class "%win_class%" is under the mouse... wiggling the mouse until the taskbar gets over here
;offset := - offset
trgX -= round(oX/2)
trgY -= round(oY/2)
oX := -oX
oY := -oY
if count = 50
{
OutputDebug, MoveTaskbar - wiggling isn't working, so I'm giving up.
return
}
}
else
break
}
OutputDebug MoveTaskbar - taskbar successfully moved
SendInput {Enter}
}
왜 downvote? 그것은 완벽하게 공식화 된 질문입니다. 반신 반의하는 의도에 관해서는, 나는 여기에서 대답되는 것이 훨씬 더 악화 된 것을 보았다. – Thomas
음, Thomas는 프로그램이해야 할 일이 아니기 때문에 질문이 유용하지 않다는 주장을 할 수 있습니다. 그러나 우리는 민장 프로그램의 의도를 알지 못하기 때문에 의문의 여지를 남겨 두지 않겠습니까? –
"프로그램이해야 할 일이 아닙니다"- 정말요? 당신은 그 결론 Rob에 어떻게 도착합니까? 다중 모니터 환경에서 작업 한 적이 있다면 UltraMon과 같은 유형의 앱 (http://www.realtimesoft.com/ultramon/)이 거의 필수적이라는 것을 알고있을 것입니다. 누가 어떤 프로그램을해야만하는지 하나님을 임명 한 사람은 누구입니까? 이것은 매우 좋은 질문입니다. +1. – Gerard