Jump to content

MsgBox not pause script


 Share

Recommended Posts

I have a timer that pops up a Msgbox when it runs out. I have it continue counting during this period. However, you cant see time that has elapsed passed until you click ok on the msgbox.

Is there a way to prevent this from happening?

Link to comment
Share on other sites

Msgbox will pause the script until it's been closed. The only thing i can think of would be instead of msgbox() run another script that creates a msgbox so that one can continue.

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

I have a timer that pops up a Msgbox when it runs out. I have it continue counting during this period. However, you cant see time that has elapsed passed until you click ok on the msgbox.

Is there a way to prevent this from happening?

Code your own GuiCreate() instead of using the default MsgBox(). It's not that hard. Post what you get for some help if you get stuck.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I have a timer that pops up a Msgbox when it runs out. I have it continue counting during this period. However, you cant see time that has elapsed passed until you click ok on the msgbox.

Is there a way to prevent this from happening?

; Move Message Box
; Author - herewasplato

_MoveMsgBox(0, "testTitle", "testText", 0, 10)

Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x, $y)
    Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2)
    If $file = -1 Then Return;if error, give up on the move
    
    Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
    Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")'
    Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')'
    FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
    FileClose($file)
    
    Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3")
    
    MsgBox($MBFlag, $MBTitle, $MBText)
    
    FileDelete(EnvGet("temp") & "\MoveMB.au3")
EndFunc;==>_MoveMsgBox; Move Message Box

... Now they can see it... many other helpful scriptlets here too

Autoit Wrappers

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

; Move Message Box
; Author - herewasplato

_MoveMsgBox(0, "testTitle", "testText", 0, 10)

Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x, $y)
    Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2)
    If $file = -1 Then Return;if error, give up on the move
    
    Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
    Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")'
    Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')'
    FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
    FileClose($file)
    
    Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3")
    
    MsgBox($MBFlag, $MBTitle, $MBText)
    
    FileDelete(EnvGet("temp") & "\MoveMB.au3")
EndFunc;==>_MoveMsgBox; Move Message Box

... Now they can see it... many other helpful scriptlets here too

Autoit Wrappers

8)

Thanks guys...

@Valuater The reason they can't see elapsed time is not because of box is in the way of the timer. The timer stops counting up until you click OK. (Although after you do click ok and the timer starts counting again, it actually start counting from when timer stopped, not from time msgbox was clicked.) I will try creating a GUI instead of msgbox.

Link to comment
Share on other sites

Move Message Box

But it's only for installed AutoIt, and what about compiled program?

I suggesting this method:

#NoTrayIcon

If $CmdLine[0] > 0 And $CmdLine[1] = "/ShowMsgBox" Then
    MsgBox(64, "MsgBox", "Some text")
    Exit
EndIf

Opt("TrayIconHide", 0)

_CallCmdLine("/ShowMsgBox")


For $i = 1 To 5000
    ConsoleWrite("Here is what the parent script process doing; Counting untill 5000 ;) [" & $i & "]" & @LF)
Next

Func _CallCmdLine($Cmd)
    Local $RunLine = @AutoItExe & ' "' & @ScriptFullPath & '" ' & $Cmd
    If @Compiled Then $RunLine = @AutoItExe & ' ' & $Cmd
    Run($RunLine)
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

But it's only for installed AutoIt, and what about compiled program?

No it's not!

When the application is compiled and even run on a computer without autoit installed you can still run a second third etc etc script by calling @Autoitexe & " /AutoIt3ExecuteScript "

It will use the autoit executable which is compilled

If you run Msgbox(0,"",@autoitexe) on a compiled script it will point to the compiled script!

Edited by ChrisL
Link to comment
Share on other sites

I have a timer that pops up a Msgbox when it runs out. I have it continue counting during this period. However, you cant see time that has elapsed passed until you click ok on the msgbox.

Is there a way to prevent this from happening?

look here

Link to comment
Share on other sites

When the application is compiled and even run on a computer without autoit installed you can still run a second third etc etc script by calling @Autoitexe & " /AutoIt3ExecuteScript "

Wow! ;) so the compiled script can be used as an interpratator for sources scripts?! it's amaizing! thanks, i didn't know about it :) .

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

And about the moving MsgBox, it can be done without using temp files:

_MoveMsgBox(64, "Hello World!", "Hi!", 0, 10)

Func _MoveMsgBox($Flag, $Title, $Text, $X, $Y, $Time=0)
    Run(@AutoItExe & ' /AutoIt3ExecuteLine  "MsgBox(' & $Flag & ', ''' & $Title & ''', ''' & $Text & ''',' & $Time & ')"')
    WinWait($Title)
    WinMove($Title, $Text, $X, $Y)
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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...