Jump to content

Gui And Loop Problem


Recommended Posts

I noticed that when I create GUI window with a While.....Wend loop the script is being paused if I click and hold my mouse down on GUI window. If you performe timed commands such as Adlibenable, this is really annoying.

Is there a way to go around that ?

Edited by sheckandar
Live and Learn, 'cause Knowledge is Super Power.
Link to comment
Share on other sites

In the example below we have While....Wend loop and AdlibEnable function. If I click and hold my left mouse button down on GUI window, script is paused for as long as I hold the left mouse button.

#include<GUIConstants.au3>
  
  AdlibEnable("message", 4000)
  
  GUICreate("Test GUI", 200, 200, -1 , -1)
  GUISetState()
  
  While 1
      $msg = GUIGetMsg()
      Select
      Case $msg = $GUI_EVENT_CLOSE
          Exit
      EndSelect
      Sleep(2000)
      MsgBox(64, "Test", "This box is in While 1 loop", 3)
  WEnd
  
  Func message()
  MsgBox(64, "Test2", "This box is in message() function", 3)
  EndFunc
Live and Learn, 'cause Knowledge is Super Power.
Link to comment
Share on other sites

In the example below we have While....Wend loop and AdlibEnable function. If I click and hold my left mouse button down on GUI window, script is paused for as long as I hold the left mouse button.

#include<GUIConstants.au3>
  
  AdlibEnable("message", 4000)
  
  GUICreate("Test GUI", 200, 200, -1 , -1)
  GUISetState()
  
  While 1
      $msg = GUIGetMsg()
      Select
      Case $msg = $GUI_EVENT_CLOSE
          Exit
      EndSelect
      Sleep(2000)
      MsgBox(64, "Test", "This box is in While 1 loop", 3)
  WEnd
  
  Func message()
  MsgBox(64, "Test2", "This box is in message() function", 3)
  EndFunc

Not on my laptop it doesn't, it keeps running

Link to comment
Share on other sites

Not on my laptop it doesn't, it keeps running

Doesnt hang on my laptop or my other 2 computers here. Not sure why yours would pause like that.

EDIT: TYPO

Edited by Don N

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to comment
Share on other sites

  • Moderators

click and hold the title bar then move the window around.. you will see

8)

Ha!!, I've never noticed that...

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Ha!!, I've never noticed that...

I guest since no one noticed it before, it's not such a big deal.

But I would still like to know if there is a way around that.

Live and Learn, 'cause Knowledge is Super Power.
Link to comment
Share on other sites

  • Moderators

I guest since no one noticed it before, it's not such a big deal.

But I would still like to know if there is a way around that.

Have you thought of making your own title bar?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Have you thought of making your own title bar?

I have, but it happens with any control in GUI window, such as scroll bar or a label.

Live and Learn, 'cause Knowledge is Super Power.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...