Automation 自动热键不适用于CarbonPoker应用程序

Automation 自动热键不适用于CarbonPoker应用程序,automation,autohotkey,Automation,Autohotkey,我已经在其他窗口(如计算器)上测试了我的脚本,所以这不仅仅是我的脚本的问题,而是当我运行CarbonPoker应用程序时,表窗口不会移动。我可以激活窗口,我可以获取标题并用MsgBox显示它,但我无法让它移动 我试过了 WinMove,0,0 WinGetTitle, Title, A WinMove,ahk_id %Title%,, %xval%,%yval%,%width%,%height% WinMove,%Title%,, %xval%,%yval%,%width%,%height%

我已经在其他窗口(如计算器)上测试了我的脚本,所以这不仅仅是我的脚本的问题,而是当我运行CarbonPoker应用程序时,表窗口不会移动。我可以激活窗口,我可以获取标题并用MsgBox显示它,但我无法让它移动

我试过了

WinMove,0,0
WinGetTitle, Title, A
WinMove,ahk_id %Title%,, %xval%,%yval%,%width%,%height%
WinMove,%Title%,, %xval%,%yval%,%width%,%height%
我已经试过了

WinMove,0,0
WinGetTitle, Title, A
WinMove,ahk_id %Title%,, %xval%,%yval%,%width%,%height%
WinMove,%Title%,, %xval%,%yval%,%width%,%height%
我已经试过了

WinMove,0,0
WinGetTitle, Title, A
WinMove,ahk_id %Title%,, %xval%,%yval%,%width%,%height%
WinMove,%Title%,, %xval%,%yval%,%width%,%height%
是否有一些应用程序无法移动其窗口?或者,有没有一种方法仍然适用于此类应用程序?谢谢。

代码已更新。现在,若窗口与其他窗口重叠,则可以移动该窗口。还为WinTitle添加了变量

您也可以尝试以其他方式移动窗口:

CoordMode, Mouse, Screen ;sets coordinate mode relative to screen.

DestX:=200 ; the x coordinate of the point where you want to see left upper point of window.
DestY:=10 ; the y coordinate of the point where you want to see left upper point of window.
WinTitleVar:="Notepad" ; The part of WinTitle of window that we need to move.

;Here are shift variables. What they meen? You cant just drug by left upper corner of window. You need to shift slightly right and down to be able to drag window. That variables are giving that shift to your coordinates.
ShiftX:= 30 ; shift for x coordinate.
ShiftY:= 10 ; shift for y coordinate.

DestX:= DestX + ShiftX ; apply shift to DestX .
DestY:= DestY + ShiftY ; apply shift to DestY .

SetTitleMatchMode, 2 ; Whith that command a window's title can contain WinTitle anywhere inside it to be a match. It is for WinGetPos command. You can remove this command, but then you need to use exact title in WinGetPos command.
WinGetPos, InitX, InitY,,, %WinTitleVar% ; get current upper left position of notepad window.
InitX:= InitX + ShiftX ; apply shift to InitX .
InitY:= InitY + ShiftY ; apply shift to InitY .

WinActivate, %WinTitleVar% ; Activates Window. This command is here in cases if other window overlaps the window that we need to move.
Click, Left, Down, %InitX%, %InitY% ; Click the left button but dont release it at the shifted coordinates of current window location. 
MouseMove, %DestX%, %DestY% ; Move mouse to the shifted destination coordinates.
Click, Left, Up ; Release Left mouse button.

我尽可能多地注释代码,但如果您有任何问题,请随时提问。

首先,如果您的其他应用程序以管理员身份运行,则您的脚本也需要以相同的管理员权限运行。我会先检查一下

接下来,您可以尝试使用hwnd而不是标题:

; hover mouse over the window, and press f3 to move window

f3::
   MouseGetPos,,, hwnd
   WinMove, ahk_id %hwnd%,, 0, 0
return

另外,WinGet OutputVar为null,或者如果我使用另一种方法:UniqueID:=WinActive%Title%,那么UniqueID为0x0Try UniqueID:=WinExistTitleDid是否检查任何答案?他们为你工作吗?