Sign in to follow this  
Followers 0
Rawox

4 Notepad Windows Beside Each other

11 posts in this topic

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.jpg

Could 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 :)

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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")

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Rawox

Share this post


Link to post
Share on other sites

WOW THAT WORKS!!!!! BLUELAMP OWNS.

Thank you so much, I was searching for this for like an hour... How can I thank u?

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

Your thanks is enough for me :)

Ok, Thank you again than. When I saw it was working I was jumping >_<

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

POSTED IN NEW TOPIC

Edited by Rawox

Share this post


Link to post
Share on other sites

How does this go for you?

Const $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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0