Jump to content
Sign in to follow this  
shamsh

WinMove function doesn't want to work - Help

Recommended Posts

My first script. I'm attempting to resize a window to my preference.

Run ( "notepad.exe")
WinActivate("Untitled - Notepad", "")
WinMove ( "Untitled - Notepad", "", 2739, 558, 459, 612 )
Sleep (500)
Run ( 'C:\Program Files\Mozilla Firefox\firefox.exe' )

But it doesn't seem to be working. After searching through the online doc and forum... i'm completely confused at why it won't work. I'm sure i'm doing something stupid. :)

While i'm at it. Does the WinMove function only work on text files? (questioned due to the requisite for _text_ param in WinMove function). i.e. if i set the following code which loads Windows Picture viewer... and then attempt resize as such:

Run ( 'rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen C:\Documents and Settings\someone\My Documents\My Pictures\folder\47.JPG' )
WinActivate("47.JPG - Windows Picture and Fax Viewer", "")
WinMove ( "47.JPG - Windows Picture and Fax Viewer", "", 2739, 558, 459, 612 )
Sleep (500)
Run ( 'C:\Program Files\Mozilla Firefox\firefox.exe' )

would it work?

Thanks

Shams

Share this post


Link to post
Share on other sites

WinMove ( "Untitled - Notepad", "", 2739, 558, 459, 612 )

WinMove ( "title", "text", x, y [, width [, height]] )

:)

Edited by Makkhdyn

Share this post


Link to post
Share on other sites

This should work:

Run("rundll32.exe shimgvw.dll, ImageView_Fullscreen C:\Documents and Settings\someone\My Documents\My Pictures\folder\47.JPG")
WinWaitActive("47.JPG - Windows Picture and Fax Viewer", "")
WinMove("47.JPG - Windows Picture and Fax Viewer", "", 2739, 558, 459, 612)
Sleep(500)
Run('C:\Program Files\Mozilla Firefox\firefox.exe')
(You can also use WinSetState instead WinMove).

Share this post


Link to post
Share on other sites

You can also use WinSetState instead WinMove).

Are you sure of this? :)

If yes, please show an example.

Share this post


Link to post
Share on other sites

WinMove ( "Untitled - Notepad", "", 2739, 558, 459, 612 )

WinMove ( "title", "text", x, y [, width [, height]] )

:)

<{POST_SNAPBACK}>

i don't get what you're trying to point out... :D

No WinWait...

Run ( "notepad.exe")
WinWait(("Untitled - Notepad", "")
WinMove ( "Untitled - Notepad", "", 2739, 558, 459, 612 )
Sleep (500)
Run ( 'C:\Program Files\Mozilla Firefox\firefox.exe' )

<{POST_SNAPBACK}>

I'm using WinActivate.... WinWait?

@eJan... i will try WinSetState tommorow at work.... thanks (example would be useful as MHz said :D

thanks

i'll post my results tommorow (late night for most of u guys :huh: )

Share this post


Link to post
Share on other sites

No WinWait...

Run ( "notepad.exe")
WinWait(("Untitled - Notepad", "")
WinMove ( "Untitled - Notepad", "", 2739, 558, 459, 612 )
Sleep (500)
Run ( 'C:\Program Files\Mozilla Firefox\firefox.exe' )

<{POST_SNAPBACK}>

u da man! :)

thanks guys!

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...