Sign in to follow this  
Followers 0
Shyke

Window Maximize

28 posts in this topic

How could I select a window and maximize it without using the run command?

Share this post


Link to post
Share on other sites



How could I select a window and maximize it without using the run command?

<{POST_SNAPBACK}>

check out WinActivate and WinSetState

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Thank-you very much, I will try that.

Share this post


Link to post
Share on other sites

Didn't work...

I used:

WinActivate("wowemu.exe")
WinSetState("C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe", "", @SW_MINIMIZE)

It didn't make it maximize...

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Didn't work...

I used:

WinActivate("wowemu.exe")
WinSetState("C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe", "", @SW_MINIMIZE)

It didn't make it maximize...

<{POST_SNAPBACK}>

u dont put the pathname..just put the title of the window WinSetState("WowMenu","",@SW_MINIMIZE) Edited by B3TA_SCR1PT3R

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites

I am not quite that bad of a programmer...

" C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe " is the title.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I am not quite that bad of a programmer...

" C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe " is the title.

<{POST_SNAPBACK}>

oh lol

WinActivate("C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe","")
WinSetState("C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe","",@SW_MAXIMIZE")
Edited by B3TA_SCR1PT3R

[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites

I am not quite that bad of a programmer...

" C:\Documents and Settings\Shyke\Desktop\Mock-Up\WoWemu.exe " is the title.

<{POST_SNAPBACK}>

why not just use

Opt("WinTitleMatchMode",4)
WinActivate("wowemu")
WinSetState("wowemu","",@SW_MAXIMIZE)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Sleep(1000)
WinSetOnTop("wowemu.exe", "", 1)
opt("WinTitleMatchMode", 4)
ProcessWait("wowemu.exe")
WinActivate("wowemu")
ProcessWait("wowemu.exe")
WinSetState("wowemu", "", @SW_MAXIMIZE)
ProcessWait("wowemu.exe")

That code does not work!!!

Share this post


Link to post
Share on other sites

Sleep(1000)
opt("WinTitleMatchMode", 4)
WinSetOnTop("wowemu.exe", "", 1)
ProcessWait("wowemu.exe")
WinActivate("wowemu")
ProcessWait("wowemu.exe")
WinSetState("wowemu", "", @SW_MAXIMIZE)
ProcessWait("wowemu.exe")

<{POST_SNAPBACK}>


[right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right]

Share this post


Link to post
Share on other sites

And yet again still no worky...

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I tried this numerous times and it worked

notice " your program is already running"

Run("explorer.exe", "", @SW_MINIMIZE )
Sleep(1500)
; the program is already running ( your program)
WinActivate("My Documents"); title i want to activate ( give focus ) 
WinWait("")
WinSetState("", "", @SW_MAXIMIZE)

i thought i saw your window title as "G:\WOW\Wowemu.exe" ( or close to that ) in your other post

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Wow... now I don't know if it my computer or not!

Download this: http://www.geocities.com/shykexmaster/MockUp.zip

And try it with this code:

HotKeySet("{ESC}", "Terminate")

MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Read read-me for other credits and information!")

While 1
    Sleep(2500)
    Start_WoW()
WEnd

Func Start_WoW()
    If Not ProcessExists("wowemu.exe") Then
        Sleep(1000)
        Run("loader_new.exe")
    EndIf

    ProcessWait("wowemu.exe")
    If ProcessExists("loader_new.exe") Then
        ProcessClose("loader_new.exe")
    EndIf

    Sleep(1000)
    opt("WinTitleMatchMode", 4)
    WinActivate("wowemu")
    WinWait("")
    WinSetState("", "", @SW_MAXIMIZE)

    $pixel = PixelGetColor(93, 95)

    If $pixel = 16776960 Then
        ProcessClose("wowemu.exe")
    EndIf
EndFunc

Func Terminate()
    Exit 0
EndFunc

Does the script work with those on your computer?

Share this post


Link to post
Share on other sites

first do this

;opt("WinTitleMatchMode", 4)

^ comment it out

then let me know

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

OMG!

YES!!!

It finally works!!

Thank-you, all of you that helped!!!

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

OK... I tested your program and it worked

here is the code

HotKeySet("{ESC}", "Terminate")

MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Read read-me for other credits and information!")

Start_WoW()

While 1
    Sleep(2500)
    
WEnd

Func Start_WoW()
    If Not ProcessExists("wowemu.exe") Then
        Sleep(1000)
        Run("C:\Temp\MockUp\loader_new.exe")
    EndIf

    ProcessWait("wowemu.exe")
    If ProcessExists("loader_new.exe") Then
        ProcessClose("loader_new.exe")
    EndIf

    Sleep(1000)
  ;opt("WinTitleMatchMode", 4)
    WinActivate("C:\Temp\MockUp\loader_new.exe")
    WinWait("")
    WinSetState("", "", @SW_MAXIMIZE)

    $pixel = PixelGetColor(93, 95)

    If $pixel = 16776960 Then
        ProcessClose("wowemu.exe")
    EndIf
EndFunc

Func Terminate()
    Exit 0
EndFunc

it disappeared so fast that i test with this statement

$pixel = "" ; PixelGetColor(93, 95)

and it stayed on my screen... then i removed the "" ; like it was

$pixel = PixelGetColor(93, 95)

and it closed the dos window

again YES it worked

8)

EDIT

Oh GREAT.... after all that effort he's got right.... thats really good for you and your desire (frustration too) .... happy for ya

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

alright dude, I tracked you down through like 3 threads to give you this, I'm sure you have a way to do this now based on your post, but I was in an older post, I hope this helps someone some day at least ;)

Dim $t
Dim $line
Dim $processID

HotKeySet("{ESC}", "Terminate")

MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Read read-me for other credits and information!")

Call("Start_WoW")

While 1
    Call("Start_WoW")
    Sleep(5000)
WEnd

Func Start_WoW()
    If Not ProcessExists ("wowemu.exe") Then
        $processID = Run("wowemu.exe", "", @SW_MINIMIZE, 6)
    EndIf
    Sleep(1000)
    $line = StdoutRead($processID)
    If StringInStr($line, ":This key is not for this computer.") Then Call("Stop_WoW")
EndFunc

Func Stop_WoW()
    $processID = ProcessExists("wowemu.exe")
    If $processID Then ProcessWaitClose($processID)
    Sleep(100)
EndFunc
    
Func Terminate()
    Exit 0
EndFunc

requires a beta of some sort, but if nothing else, i thought it was an elegant solution.

Edit 1: it's in reply to your closing based on text in it. I decided to post this because it doesnt rely on text color or pixel checking, but based on the text :P

Edit 2: beta 3.1.1.74

Edited by Hayly

Share this post


Link to post
Share on other sites

Hayly... that one didn't work at all for varification if it works anyways thank-you for giving me some good idea's.

Here's the bad new...

Another problem has arised which is that on my bosses computer it does everything but it doesn't work for varification pixelwise so if it's a failure then it just treats it as a success... any idea?

Share this post


Link to post
Share on other sites

Hayly... that one didn't work at all for varification if it works anyways thank-you for giving me some good idea's.

Here's the bad new...

Another problem has arised which is that on my bosses computer it does everything but it doesn't work for varification pixelwise so if it's a failure then it just treats it as a success... any idea?

<{POST_SNAPBACK}>

expand your pixel search... you only have this

$pixel = PixelGetColor(93, 95)

try more of the abilities pixelsearch has by creating more of a boxed area to search

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

look at it in help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

$pixel = PixelGetColor(93, 95) worked on 8 resolutions, I don't think it is that.

Are there any dlls or anything that must be sent with the program or other possible problems?

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