Guten Morgen,
ich würde gerne auf einem PC eine Datei schreiben/haben womit 2 Tabs auf 2 Monitoren aufgehen wenn man den PC startet, habe bisher viel bei Google gesucht, aber bin nicht wirklich fündig geworden.
Das was mir wirklich weiterhelfen könnte wäre, glaube ich dies hier:
/*
; 2 Urls auf 2 Monitoren
#Region ;**** Includes ****
#Include <Array.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#EndRegion ;**** Includes ****
Global $url = 'www.autoit.de'
Global $url1 = 'www.autoitscript.com'
Global $aScreenResolution
$aScreenResolution = _DesktopDimensions()
ConsoleWrite("Example of _DesktopDimensions():" & @CRLF & _
"Number of monitors = " & $aScreenResolution[1] & @CRLF & _
"Primary Width = " & $aScreenResolution[2] & @CRLF & _
"Primary Height = " & $aScreenResolution[3] & @CRLF & _
"Secondary Width = " & $aScreenResolution[4] & @CRLF & _
"Secondary Height = " & $aScreenResolution[5] & @CRLF)
$pid = Run('"c:\Program Files (x86)\Mozilla Firefox\firefox.exe "' & $url)
ConsoleWrite($pid & ' ' & ProcessExists('firefox.exe')& @CRLF)
Sleep(1500)
$re = _WinGetHandleByPID(ProcessExists('firefox.exe'))
;~ ConsoleWrite(@error & @CRLF)
;~ _ArrayDisplay($re)
WinMove($re[1][1], '', 100, 100) ; an Position 100, 100 verschieben
Sleep(1000)
WinMove($re[1][1], '', $aScreenResolution[2], 0)
; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
; #FUNCTION# ====================================================================================================================
; Name ..........: _DesktopDimensions
; Description ...: Returns an array containing information about the primary and virtual monitors.
; Syntax ........: _DesktopDimensions()
; Return values .: Success - Returns a 6-element array containing the following information:
; $aArray[0] = Number of elements.
; $aArray[1] = Total number of monitors.
; $aArray[2] = Width of the primary monitor.
; $aArray[3] = Height of the primary monitor.
; $aArray[4] = Total width of the desktop including the width of multiple monitors. Note: If no secondary monitor this will be the same as $aArray[2].
; $aArray[5] = Total height of the desktop including the height of multiple monitors. Note: If no secondary monitor this will be the same as $aArray[3].
; Author ........: guinness
; Remarks .......: WinAPI.au3 must be included i.e. #include <winapi.au3>
; Related .......: @DesktopWidth, @DesktopHeight, _WinAPI_GetSystemMetrics
; Example .......: Yes
; ===============================================================================================================================
Func _DesktopDimensions()
Local $aReturn[6] = [5, _
_WinAPI_GetSystemMetrics($SM_CMONITORS), _ ; Number of monitors.
_WinAPI_GetSystemMetrics($SM_CXSCREEN), _ ; Width or Primary monitor.
_WinAPI_GetSystemMetrics($SM_CYSCREEN), _ ; Height or Primary monitor.
_WinAPI_GetSystemMetrics($SM_CXVIRTUALSCREEN), _ ; Width of the Virtual screen.
_WinAPI_GetSystemMetrics($SM_CYVIRTUALSCREEN)] ; Height of the Virtual screen.
Return $aReturn
EndFunc ;==>_DesktopDimensions
Func _WinGetHandleByPID($vProcess, $nShow = 1)
; Get Window Handle by PID
; Author Hubertus
; derived from Smoke_N's script with the same name,
; but to handle more than one process with the same name
; and to return handle of newest window ($nShow = 2).
;
; $vProcess = Processname(e.g. "Notepad.exe") or Processnumber(e.g. 4711 )
; $nShow = -1 "All (Visble or not)", $nShow = 0 "Not Visible Only", $nShow = 1 "Visible Only", $nShow = 2 "return handle of newest window "
; @error = 0 Returns array of matches. Array[0][0] and @extended shows number of matches.
; @error = 0 and $nShow = 2 return handle of newest window
; Array[n][0] shows windows title. Array[n][1] shows windows handle. n = 1 to @extended
; @error = 1 Process not found.
; @error = 2 Window not found.
If Not ProcessExists($vProcess) Then Return SetError(1, 0, 0) ; no matching process
Local $iWinList, $aWinList = WinList()
Local $iResult, $aResult[UBound($aWinList)][2]
Local $iProcessList, $aProcessList = ProcessList($vProcess)
If $aProcessList[0][0] = 0 Then Local $aProcessList[2][2] = [[1, 0],["", $vProcess]]
For $iWinList = 1 To $aWinList[0][0]
For $iProcessList = 1 To $aProcessList[0][0]
If WinGetProcess($aWinList[$iWinList][1]) = $aProcessList[$iProcessList][1] Then
If $nShow > -1 And Not $nShow = (2 = BitAND(WinGetState($aWinList[$iWinList][1]), 2)) Then ContinueLoop
$iResult += 1
$aResult[$iResult][0] = $aWinList[$iWinList][0]
$aResult[$iResult][1] = $aWinList[$iWinList][1]
EndIf
Next
Next
If $iResult = 0 Then Return SetError(2, 0, 0) ; no window found
ReDim $aResult[$iResult + 1][2]
$aResult[0][0] = $iResult
If $nShow = 2 Then Return SetError(0, $iResult, $aResult[1][1])
Return SetError(0, $iResult, $aResult)
EndFunc ;==>_WinGetHandleByPID
*/
"
Quelle: https://autoit.de/index.php?thread/...f-2-monitoren-beim-starten-fullscreen-öffnen/
"
aber da ich noch sehr neu auf dem Gebiet bin kann ich nicht wirklich was damit anfangen, hier das richtige einzutragen, bzw. meine bisherigen Versuche waren leider ohne Erfolg.
Ich würde es vorzugsweise gerne mit dem Internet Explorer haben, Google Chrome ist aber auch vorhanden.
Auflösung Primär Bildschirm: 1280*1024
Auflösung Sekundärer Bildschirm: 1920*1080
Gruß Chris
ich würde gerne auf einem PC eine Datei schreiben/haben womit 2 Tabs auf 2 Monitoren aufgehen wenn man den PC startet, habe bisher viel bei Google gesucht, aber bin nicht wirklich fündig geworden.
Das was mir wirklich weiterhelfen könnte wäre, glaube ich dies hier:
/*
; 2 Urls auf 2 Monitoren
#Region ;**** Includes ****
#Include <Array.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#EndRegion ;**** Includes ****
Global $url = 'www.autoit.de'
Global $url1 = 'www.autoitscript.com'
Global $aScreenResolution
$aScreenResolution = _DesktopDimensions()
ConsoleWrite("Example of _DesktopDimensions():" & @CRLF & _
"Number of monitors = " & $aScreenResolution[1] & @CRLF & _
"Primary Width = " & $aScreenResolution[2] & @CRLF & _
"Primary Height = " & $aScreenResolution[3] & @CRLF & _
"Secondary Width = " & $aScreenResolution[4] & @CRLF & _
"Secondary Height = " & $aScreenResolution[5] & @CRLF)
$pid = Run('"c:\Program Files (x86)\Mozilla Firefox\firefox.exe "' & $url)
ConsoleWrite($pid & ' ' & ProcessExists('firefox.exe')& @CRLF)
Sleep(1500)
$re = _WinGetHandleByPID(ProcessExists('firefox.exe'))
;~ ConsoleWrite(@error & @CRLF)
;~ _ArrayDisplay($re)
WinMove($re[1][1], '', 100, 100) ; an Position 100, 100 verschieben
Sleep(1000)
WinMove($re[1][1], '', $aScreenResolution[2], 0)
; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
; #FUNCTION# ====================================================================================================================
; Name ..........: _DesktopDimensions
; Description ...: Returns an array containing information about the primary and virtual monitors.
; Syntax ........: _DesktopDimensions()
; Return values .: Success - Returns a 6-element array containing the following information:
; $aArray[0] = Number of elements.
; $aArray[1] = Total number of monitors.
; $aArray[2] = Width of the primary monitor.
; $aArray[3] = Height of the primary monitor.
; $aArray[4] = Total width of the desktop including the width of multiple monitors. Note: If no secondary monitor this will be the same as $aArray[2].
; $aArray[5] = Total height of the desktop including the height of multiple monitors. Note: If no secondary monitor this will be the same as $aArray[3].
; Author ........: guinness
; Remarks .......: WinAPI.au3 must be included i.e. #include <winapi.au3>
; Related .......: @DesktopWidth, @DesktopHeight, _WinAPI_GetSystemMetrics
; Example .......: Yes
; ===============================================================================================================================
Func _DesktopDimensions()
Local $aReturn[6] = [5, _
_WinAPI_GetSystemMetrics($SM_CMONITORS), _ ; Number of monitors.
_WinAPI_GetSystemMetrics($SM_CXSCREEN), _ ; Width or Primary monitor.
_WinAPI_GetSystemMetrics($SM_CYSCREEN), _ ; Height or Primary monitor.
_WinAPI_GetSystemMetrics($SM_CXVIRTUALSCREEN), _ ; Width of the Virtual screen.
_WinAPI_GetSystemMetrics($SM_CYVIRTUALSCREEN)] ; Height of the Virtual screen.
Return $aReturn
EndFunc ;==>_DesktopDimensions
Func _WinGetHandleByPID($vProcess, $nShow = 1)
; Get Window Handle by PID
; Author Hubertus
; derived from Smoke_N's script with the same name,
; but to handle more than one process with the same name
; and to return handle of newest window ($nShow = 2).
;
; $vProcess = Processname(e.g. "Notepad.exe") or Processnumber(e.g. 4711 )
; $nShow = -1 "All (Visble or not)", $nShow = 0 "Not Visible Only", $nShow = 1 "Visible Only", $nShow = 2 "return handle of newest window "
; @error = 0 Returns array of matches. Array[0][0] and @extended shows number of matches.
; @error = 0 and $nShow = 2 return handle of newest window
; Array[n][0] shows windows title. Array[n][1] shows windows handle. n = 1 to @extended
; @error = 1 Process not found.
; @error = 2 Window not found.
If Not ProcessExists($vProcess) Then Return SetError(1, 0, 0) ; no matching process
Local $iWinList, $aWinList = WinList()
Local $iResult, $aResult[UBound($aWinList)][2]
Local $iProcessList, $aProcessList = ProcessList($vProcess)
If $aProcessList[0][0] = 0 Then Local $aProcessList[2][2] = [[1, 0],["", $vProcess]]
For $iWinList = 1 To $aWinList[0][0]
For $iProcessList = 1 To $aProcessList[0][0]
If WinGetProcess($aWinList[$iWinList][1]) = $aProcessList[$iProcessList][1] Then
If $nShow > -1 And Not $nShow = (2 = BitAND(WinGetState($aWinList[$iWinList][1]), 2)) Then ContinueLoop
$iResult += 1
$aResult[$iResult][0] = $aWinList[$iWinList][0]
$aResult[$iResult][1] = $aWinList[$iWinList][1]
EndIf
Next
Next
If $iResult = 0 Then Return SetError(2, 0, 0) ; no window found
ReDim $aResult[$iResult + 1][2]
$aResult[0][0] = $iResult
If $nShow = 2 Then Return SetError(0, $iResult, $aResult[1][1])
Return SetError(0, $iResult, $aResult)
EndFunc ;==>_WinGetHandleByPID
*/
"
Quelle: https://autoit.de/index.php?thread/...f-2-monitoren-beim-starten-fullscreen-öffnen/
"
aber da ich noch sehr neu auf dem Gebiet bin kann ich nicht wirklich was damit anfangen, hier das richtige einzutragen, bzw. meine bisherigen Versuche waren leider ohne Erfolg.
Ich würde es vorzugsweise gerne mit dem Internet Explorer haben, Google Chrome ist aber auch vorhanden.
Auflösung Primär Bildschirm: 1280*1024
Auflösung Sekundärer Bildschirm: 1920*1080
Gruß Chris