Rawox Posted September 27, 2008 Posted September 27, 2008 Is there anyway to open 4 notepad windows beside or under each other, a bit like in the image.Link to image: http://i174.photobucket.com/albums/w112/rawox/4Windows.jpgCould u please post some code, I started it yesterday. And doing an script (1000+) Lines. It's like an story and I really need this
Pain Posted September 27, 2008 Posted September 27, 2008 Have you tried with WinMove() and @DesktopHeight, @DesktopWidth? When you tried you can post your code and we will help you if you still got any problem.
ChromeFan Posted September 27, 2008 Posted September 27, 2008 just a example not working code Run("Notepad.exe") WinMove("Title", "", 0, 0, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Title", "", 100, 100, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Title", "", 200, 200, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Title", "", 300, 300, 100, 500) you can also use winwait() for wating for window to be activated and then move, resize it. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel
Rawox Posted September 27, 2008 Author Posted September 27, 2008 As some people maybe have read. I started today... So the only thing I have is this. I searched the help file for @DesktopHeight, @DesktopWidth but didn't know what it meant... Can someone please help me? ;Window 4 Run("notepad.exe") WinWaitActive("Untitled - Notepad") ;Window 3 Run("notepad.exe") WinWaitActive("Untitled - Notepad") ;Window 2 Run("notepad.exe") WinWaitActive("Untitled - Notepad") ;Window 1 Run("notepad.exe") WinWaitActive("Untitled - Notepad")
Rawox Posted September 27, 2008 Author Posted September 27, 2008 (edited) just a example not working code Run("Notepad.exe") WinMove("Title", "", 0, 0, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Title", "", 100, 100, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Title", "", 200, 200, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Title", "", 300, 300, 100, 500) you can also use winwait() for wating for window to be activated and then move, resize it. I Like thisone. But I'm sure I need to change the title into the name of the file, do I need something else? EDIT: Ok, I already changed it in this: Run("Notepad.exe") WinMove("Untitled - Notepad", "", 0, 0, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Untitled - Notepad", "", 100, 100, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Untitled - Notepad", "", 200, 200, 100, 500) Sleep(100) Run("Notepad.exe") WinMove("Untitled - Notepad", "", 300, 300, 100, 500) What do I need to do more? Edited September 27, 2008 by Rawox
bluelamp Posted September 27, 2008 Posted September 27, 2008 (edited) Const $WINDOWS = 4 $x = @DesktopWidth/$WINDOWS For $i=0 To $WINDOWS-1 Step 1 Run("notepad") WinWaitActive("Untitled - Notepad") WinMove("Untitled - Notepad","",$i*$x,0,$x) Send("Window "&$i+1) Next Edited September 27, 2008 by bluelamp
Rawox Posted September 27, 2008 Author Posted September 27, 2008 WOW THAT WORKS!!!!! BLUELAMP OWNS. Thank you so much, I was searching for this for like an hour... How can I thank u?
bluelamp Posted September 27, 2008 Posted September 27, 2008 WOW THAT WORKS!!!!! BLUELAMP OWNS.Thank you so much, I was searching for this for like an hour... How can I thank u?Your thanks is enough for me
Rawox Posted September 27, 2008 Author Posted September 27, 2008 Your thanks is enough for me Ok, Thank you again than. When I saw it was working I was jumping >_<
Rawox Posted September 27, 2008 Author Posted September 27, 2008 (edited) POSTED IN NEW TOPIC Edited September 27, 2008 by Rawox
BrettF Posted September 27, 2008 Posted September 27, 2008 How does this go for you? expandcollapse popupConst $WINDOWS = 4 Dim $HWNDS[$WINDOWS] $x = @DesktopWidth/$WINDOWS For $i=0 To $WINDOWS-1 $PID = Run("notepad") $HWNDS[$i] = _GETHwndFromPID ($PID) WinMove("Untitled - Notepad","",$i*$x,0,$x) ControlSetText ($HWNDS[$i], "", "[CLASS:Edit; INSTANCE:1]", "Window "&$i+1) Next Sleep (2000) For $i=0 To $WINDOWS-1 ControlSetText ($HWNDS[$i], "", "[CLASS:Edit; INSTANCE:1]", "Window "&$i+1 & @CRLF & "New Text") Next Sleep (2000) WinKill ($HWNDS[0]) $HWNDS[0] = 0 Sleep (1000) WinKill ($HWNDS[1]) $HWNDS[1] = 0 Sleep (1000) WinKill ($HWNDS[2]) $HWNDS[2] = 0 Sleep (1000) WinSetState($HWNDS[3], "", @SW_MAXIMIZE) 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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now