Jump to content

Create multiple lines in GUI


petjez
 Share

Recommended Posts

Hello,

i like to create something like a silent install script with some status messages.

In DOS i do it like this:

@Echo off

Echo Installing Program 1

program2.exe /silent >NUL

Echo.

Echo Installing Program 2

program2.exe /silent >NUL

Echo.

Echo Everything done, press a key...

pauze >NUL

In DOS this works wonderfull, the batch file waits until the program is installed and would move over to the second line. It wil display the status of the install with the DOS echo command.

Can this be done in Autoit with a more graphical status screen?

I've tried msgbox. This works, but shows a msgbox for every instaleld program. I like to see the status in 1 msgbox.

Regards,

Patrick

Link to comment
Share on other sites

There are several ways you could go about it, but for a simple start, take a look at the SplashTextOn command in the help file.

There are cleaner, nicer looking solutions, but this will be the simplest until you learn more about AutoIt scripting in general.

Link to comment
Share on other sites

What you would want to do is console write. It will work similarly to DOS and Batch files:

ConsoleWrite("Installing Program 1")
RunWait("program2.exe", "/silent")
ConsoleWrite(@CRLF)
ConsoleWrite("Installing Program 2")
RunWait("program2.exe" "/silent")
ConsoleWrite(@CRLF)
ConsoleWrite("Everything done. Now exiting.")
Exit

There you go. If you compare that to your command line version, you will quickly realize how it works.

Link to comment
Share on other sites

Link to comment
Share on other sites

i don't think i get it. I want the use the SplashTextOn option. I've tried this:

But the window is clearer and then the next message is displayed. I've also tried the ControlSetText option, but it doesn't show anything.

SplashTextOn("Title", "Message goes here.", -1, -1, -1, -1, 4, "", 24)

Sleep(2000)

SplashOff()

SplashTextOn("Titel", "bericht1", -1, -1, -1, -1, 4, "")

ControlSetText("TitleFoo", "", "Static1", "message")

sleep(2000)

ControlSetText("TitleFoo", "", "Static1", "message2")

sleep(2000)

SplashOff()

Any idea?

Patrick

Link to comment
Share on other sites

Your ControlSetText wasn't written properly, try it this way.

SplashTextOn("Title", "Message goes here.", -1, -1, -1, -1, 4, "", 24)
Sleep(2000)
SplashOff()
SplashTextOn("Title", "bericht1", -1, -1, -1, -1, 4, "")
Sleep(2000)
ControlSetText("Title", "", "Static1", "message")
sleep(2000)
ControlSetText("Title", "", "Static1", "message2")
sleep(2000)
SplashOff()

You had "TitleFoo" set for the window's title, when the window's title was set to "Title". Copy/Paste error from the example script on your part.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Hey, thanks, but it is almost the way i want it.

The window isn't closed now, but the text is not displayed underneath eachother. The text is sort of refreshed, i want al the text in 1 window, with some commands between (like the sleep command).

Patrick

Link to comment
Share on other sites

SplashTextOn("Title", "Message goes here.", -1, -1, -1, -1, 4, "", 24)
Sleep(2000)
SplashOff()
$msg="bericht1"
SplashTextOn("Titel", $msg, -1, -1, -1, -1, 4, "")
$msg &= @CRLF & "message"
ControlSetText("Titel", "", "Static1", $msg)
sleep(2000)
$msg &= @CRLF & "message2"
ControlSetText("Titel", "", "Static1", $msg)
sleep(2000)
SplashOff()

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