AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trigger after an hourglass?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
bachdog
Guest





PostPosted: Wed Sep 22, 2004 7:38 am    Post subject: Trigger after an hourglass? Reply with quote

Can I hold off a mouse click until an hourglass is gone? Here's my situation. I'm running a report and after it collects the data, it then launches a viewer. While collecting the data, which can take some time depending on the size of the report, an hourglass is present. After the data is retrieved, the viewer is automatically launched, I then have to save the report. I don't want my mouse to try to save the report until after the data has been retrieved and then shown on the viewer. I can use a delay, but that isn't as foolproof, because sometimes network activity can impact the return time of the report.

Thanks to anyone who can help.

Mark
Back to top
Pallie



Joined: 05 Jul 2004
Posts: 57
Location: London

PostPosted: Wed Sep 22, 2004 9:41 am    Post subject: Reply with quote

Hi Mark

I had a simialr question and Chris made a good suggestion here
http://www.autohotkey.com/forum/viewtopic.php?t=458&highlight=egg+timer
As a result I just put the following in the script and it worked a treat. You may need to adjust the sleep time depending on your app.
Code:
  loop, 300
  {
    sleep, 100
    if A_Cursor <> AppStarting
      break
  }


Mike
Back to top
View user's profile Send private message
bachdog
Guest





PostPosted: Thu Sep 23, 2004 8:40 pm    Post subject: Reply with quote

Thanks Mike.

I had to adjust the code you sent slightly. This is part of the same application, just a delay, so I changed AppStarting to Arrow in your code; however, if the mouse moves outside the active window then the cursor changes. I'm now working on locking the mouse from the user and setting its position in the box so the hourglass remains.

Thanks again,

Mark
Back to top
Pallie



Joined: 05 Jul 2004
Posts: 57
Location: London

PostPosted: Thu Sep 23, 2004 10:11 pm    Post subject: Reply with quote

I tried the same thing, trying to keep the mouse inside the window but it did not really work. Here is what I came up with in case it helps

Code:
#m::
CoordMode, mouse, Screen
WinGetPos, X, Y, W, H, A 
w += %x%
h += %y%
loop
{
  mousegetpos, mX, mY
  if mx < %x%
    mousemove, %x%, %my%
  if my < %y%
    mousemove, %mx%, %y%
  if mx > %w%
    mousemove, %w%, %my%
  if my > %h%
    mousemove, %mx%, %h%
  sleep, 10
}
Return

#x::
  exitapp
Return


(press Win + M to start and keep the mouse inside the current window, Win + X to stop it)

But I found there were so may other things that could upset the script (AltTab, CntrlAltDel etc) that it was not worth bothering about.

I only kept the code because I made a program whereby if you move the mouse to the edge of the screen it reappears on the opposite side which I thought might be useful one day!

Code:
#m::
CoordMode, Mouse, Screen
WinActivate, Program Manager
WinGetActiveStats, title, W, H, X, Y
w -= 10
h -= 10
loop
{
  mousegetpos, mX, mY
  if mx > %w%
    mousemove, 10, %my%
  if my > %h%
    mousemove, %mx%, 10
  if mx < 10
    mousemove, %w%, %my%
  if my < 10
    mousemove, %mx%, %h%
  sleep, 10
}
Return

#x::
  exitapp
Return


Mike
Back to top
View user's profile Send private message
jack



Joined: 04 Sep 2004
Posts: 77
Location: UK

PostPosted: Thu Sep 23, 2004 10:20 pm    Post subject: Reply with quote

you could briefly reactivate the target window and then check the cursor. you could then, if it makes sense, flip back to the window that was active at the start.

it could get a bit annoying for a user who insists on changing to another window.

jack
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group