Sign in to follow this  
Followers 0
jimmyjmmy

how to have msg on screen even after script ends

10 posts in this topic

Hi,

I want to have a message shown at the screen all the time, while the script continue to execute the rest of the codes, and so I decided to use SplashTextOn.

I can see the text splashed on the screen but it goes off after a while. So what must I do to make it stay even though the script have ended its routine.

I also dont understand the additional purpose of SplashOff since it seems to me that by default the messages are already off by default such as this :-

SplashTextOn("Example", "Splash Screen")

Sleep(5000)

SplashOff()

Thanks

Share this post


Link to post
Share on other sites



Hi,

I want to have a message shown at the screen all the time, while the script continue to execute the rest of the codes, and so I decided to use SplashTextOn.

I can see the text splashed on the screen but it goes off after a while. So what must I do to make it stay even though the script have ended its routine.

I also dont understand the additional purpose of SplashOff since it seems to me that by default the messages are already off by default such as this :-

SplashTextOn("Example", "Splash Screen")

Sleep(5000)

SplashOff()

Thanks

What I would do is:

Main Script:

FileInstall("Your Splash exe",@ScriptDir)
Run("Splash.exe")
While 1
;Your stuff here
WEndoÝ÷ ØZ+JZ²®¶­s`¤Fð¥7Æ6FWDöâgV÷C´W×ÆRgV÷C²ÂgV÷Cµ7Æ667&VVâgV÷C²¥VçFÂ&ö6W74W7BgV÷C´ÖâæWRgV÷C²Ó¥7Æ6öfb

Share this post


Link to post
Share on other sites

Hi,

I want to have a message shown at the screen all the time, while the script continue to execute the rest of the codes, and so I decided to use SplashTextOn.

I can see the text splashed on the screen but it goes off after a while. So what must I do to make it stay even though the script have ended its routine.

I also dont understand the additional purpose of SplashOff since it seems to me that by default the messages are already off by default such as this :-

SplashTextOn("Example", "Splash Screen")

Sleep(5000)

SplashOff()

Thanks

This is all assumptions, as you haven't provided a full script, or told us enough information.

So I take it you've got something like this in your script:

SplashTextOn("Example", "Splash Screen")
;Script
SplashOff()
oÝ÷ Ù8b±Ê.ÖÞ­ë(÷Â+ajëh×6
SplashTextOn("Example", "Splash Screen")
;Script
Func OnAutoItExit ( )
    SplashOff()
EndFunc

Share this post


Link to post
Share on other sites

This is all assumptions, as you haven't provided a full script, or told us enough information.

So I take it you've got something like this in your script:

SplashTextOn("Example", "Splash Screen")
;Script
SplashOff()
oÝ÷ Ù8b±Ê.ÖÞ­ë(÷Â+ajëh×6
SplashTextOn("Example", "Splash Screen")
;Script
Func OnAutoItExit ( )
    SplashOff()
EndFunc
His idea is better so use his.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

.......

This could be resolved with:

SplashTextOn("Example", "Splash Screen")
;Script
Func OnAutoItExit ( )
    SplashOff()
EndFunc
Thanks Bert and Generator.

I activate your script and I see that the message appear and goes off almost instantaneously. What I want is to have the message appear permanently on the screen even though autoIt have finished executing all the codes in that script. And it will remain there until I click something for it to go off.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

How do you suppose you can have part of the script running after the script has finished?

Can you still run notepad after windows has shut down?

It sounds to me like you need a separate script to do the splashtext with a method to close that script, this splash script does not execute any thing else other than a splash message.

You then need a second script to firstly run the splashtext.exe that you first made then run the rest of the code when it exits the first script with the splash is still running.

Once you perform whatever action it is you have decided on to tell the fist script splash to exit the splash window closes.

I suggest you look at hotkeyset() and splashtexton() splashtextoff() and while wend loops for the first splash script.

and its up to you to sort out the second.

Share this post


Link to post
Share on other sites

So Have 2 files, splash.au3, and maincode.au3

Splash.au3 contains.

SplashTextOn("Example", "Splash Screen")
ShellExecute ("maincode.au3", "", "" "run")
While 1
IF TrayGetMsg () = $TRAY_EVENT_PRIMARYDOUBLE Then Exit ;DBLL Click on the tray to close....
Wend
Func OnAutoItExit ( )
    SplashOff()
EndFunc

Maincode.au3 Contains your script. Just run splash.au3 to run the script.

See how that works??

Share this post


Link to post
Share on other sites

So you mean, you run your script, splash is shown, script runs, finishes you script exits, you click exit on splash, splash closes?

Yes, you hit bulls eyes. Thats what I meant. It is not necessary to be splash, the permanent message shown can be other messages such as gui, msgbox etc....

The message shown on the screen is a counter and I want it to be shown on the screen all the time just like a counter in the web pages and each time when a script is invoke, the message will show an increment of 1.

I have done something very simple. I use 2 scripts. Script 1 is a msgbox. script 2 activates script 1. I am sure there is a better way to do.

Thanks

----------script 1 ------------

ShellExecute("counter.au3","","","Run")

ControlClick ("Counter","Motion detector detected",2)

---------- script 2 ----------------------

$counter = FileReadLine ("test.txt")

if @error then

$counter = $counter +1

$file2 = FileOpen("test.txt", 2); 2 = Write mode (erase previous contents)

FileWriteLine($file2, $counter)

FileClose($file2)

MsgBox (48,"test read","file test.txt not found but will be created and counting "& $counter )

Else

$counter += 1

$file2 = FileOpen("test.txt", 2); 2 = Write mode (erase previous contents)

FileWriteLine($file2, $counter)

FileClose($file2)

MsgBox(0, "Counter", "Motion detector detected " & $counter &" times")

EndIf

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  
Followers 0