我使用程序多开谷歌浏览器,然后控制每个窗口的大小和位置,代码如下,但是仍然无法控制,如果把程序改为记事本或者其他,就可以控制,有没有老大知道原因啊?请不吝赐教,谢谢~~~Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i][1]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc ;==>_GetHwndFromPID
$mua = @ScriptDir & '\chrome.exe --user-data-dir="' & @ScriptDir
$1 = _GetHwndFromPID(Run($mua & "\data\m\1" & '" --disk-cache-dir="' & @ScriptDir & '\cache\m\1"', "", @SW_MAXIMIZE))
Sleep(5000)
WinMove($1, "", 0, 0, 500, 300)
$2 = _GetHwndFromPID(Run($mua & "\data\m\2" & '" --disk-cache-dir="' & @ScriptDir & '\cache\m\2"', "", @SW_MAXIMIZE))
Sleep(5000)
WinMove($2, "", 500, 0, 500, 300)
|