AutoHotkey Community

It is currently May 27th, 2012, 5:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Forcing window movement
PostPosted: May 1st, 2010, 1:47 pm 
Offline

Joined: June 20th, 2009, 8:55 pm
Posts: 19
Hello,

I have a game (EQ1) which refuses to let its window be moved. I.e., I can successfully find it with IfWinExist, but the following WinMove just doesn't do anything.

The game window "feels" just normal when moving it with a mouse, it has the regular window borders, and the Window Spy displays its values fine.

Is it possible that the application somehow intercepts the WinMove? If so... is there a more low-level way to move it?

I'm not trying to do anything fancy; I just have a background AHK script which regularly looks for certain applications and moves them to specific locations. This worked with all applications I tried so far, but not this one.

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 1st, 2010, 8:06 pm 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
maybe you should post your script? :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 1st, 2010, 9:50 pm 
Offline

Joined: June 20th, 2009, 8:55 pm
Posts: 19
The code is trivial...

Code:
loop
{
    IfWinExist, ahk_class _EverQuestwndclass
    {
        WinMove, 20, 20
        MsgBox, OK!
    }
    Sleep, 1000
}


It tells me "OK" every second but does not actually move the window.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 2nd, 2010, 12:21 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
I modified your code, see below, try this instead.

AHKIsTheBest wrote:
The code is trivial...

Code:
x=20

loop
{
    IfWinExist, ahk_class _EverQuestwndclass
    {
        WinMove, x+20, 20
        MsgBox, OK!
    }
    Sleep, 1000
}


It tells me "OK" every second but does not actually move the window.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 2nd, 2010, 7:49 am 
Huh?

My problem is that the WinMove does not do anything for this particular window.

Yes, thanks, I know that "WinMove 20,20" is a constant position. Of course I do *not* mean that it moves once and then not again. And of course this is just a simplified example, which works as intended when I replace the "ahk_class ..." with "Notepad", for example.

No matter where the window is, it is *never* moved, not to 20,20 nor to x+20,20 or whatever position I give it.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 2nd, 2010, 12:45 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
You may have to use the mouse to move it ... maybe MouseClickDrag :?:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 77 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group