Sign in to follow this  
Followers 0
ahmeddzcom

Two Command in Same Time

11 posts in this topic

#1 ·  Posted (edited)

Hi Guys

Plz i Need Two Command Run in Same Time

(;~ 1 Don't Stop And ;~ 2 D'ont Stop)   i need notify 2 separate things

;~ 1
While 1
SplashTextOn("", "1", 100, 80, 5, 5, 50, "", 20)
Sleep(2000)
SplashOff()
ExitLoop
WEnd

;~ 2
While 1
SplashTextOn("", "2", 100, 80, 105, 5, 50, "", 20)
Sleep(2000)
SplashOff()
WEnd

Tnx

Edited by ahmeddzcom

Share this post


Link to post
Share on other sites



ahmeddzcom,

You can only have one splash screen at any one time - so you cannot display both together. :(>

Why do you need 2 splash screens? Are you trying to notify 2 separate things? If so then perhaps my Notify UDF might be useful - look in my sig for the link. ;)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

BTW, your While loops aren't needed. You're not looping, so putting the commands into a loop makes no sense.


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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

BTW, your While loops aren't needed. You're not looping, so putting the commands into a loop makes no sense.

2nd loop is ;)

Edit:

This could be done like this:

1.  Create a separate script that does the SplashText

2.  Use Run + ScriptFullPath + AutoIt3ExecuteScript + ScriptPathName + any command lines you want to pass

You could create hidden GUI control(s), use these controls to set a value that the other script could read.

Then you could pass the GUI hwnd (as a number and convert to hwnd in the SplashText script), the control id number, and all the parameters that splashtext function accepts.

In a loop, you could check to see if the value is set in the hwnd+controlid, if it is, run the splash text, if it isn't, close the splashtext with splashoff.

Sounds harder than it would be.

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

You can only have one splash screen at any one time - so you cannot display both together. :(>

 

BTW, your While loops aren't needed. You're not looping, so putting the commands into a loop makes no sense.

 
 

2nd loop is  ;)

 

 

Tnx guys

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

... a little trick ...

$code1 = "while 1" & @CRLF & "SplashTextOn('', '1', 100, 80, 5, 5, 50, '', 20)" & @CRLF & "sleep(2000)" & @CRLF & "SplashOff()" & @CRLF & "WEnd"
$code2 = "while 1" & @CRLF & "SplashTextOn('', '2', 100, 80, 125, 5, 50, '', 20)" & @CRLF & "sleep(2000)" & @CRLF & "SplashOff()" & @CRLF & "WEnd"
_ExecuteScript($code1, $code2)
MsgBox(0, "Info", "the 2 Splash are running in 2 endless separate tasks")
Exit

Func _ExecuteScript($code1, $code2)
    Local $tmp1 = @TempDir & "\tempexec1.tmp"
    Local $tmp2 = @TempDir & "\tempexec2.tmp"
    Local $hwnd = FileOpen($tmp1, 26)
    FileWrite($hwnd, $code1)
    FileClose($hwnd)
    $hwnd = FileOpen($tmp2, 26)
    FileWrite($hwnd, $code2)
    FileClose($hwnd)
    $pid1 = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp1 & '"')
    $pid2 = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp2 & '"')
EndFunc   ;==>_ExecuteScript
Edited by Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

I see Chimp understood what I was talking about.


[center]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.[/center]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

 

... a little trick ...

$code1 = "while 1" & @CRLF & "SplashTextOn('', '1', 100, 80, 5, 5, 50, '', 20)" & @CRLF & "sleep(2000)" & @CRLF & "SplashOff()" & @CRLF & "WEnd"
$code2 = "while 1" & @CRLF & "SplashTextOn('', '2', 100, 80, 125, 5, 50, '', 20)" & @CRLF & "sleep(2000)" & @CRLF & "SplashOff()" & @CRLF & "WEnd"
_ExecuteScript($code1, $code2)
MsgBox(0, "Info", "the 2 Splash are running in 2 endless separate tasks")
Exit

Func _ExecuteScript($code1, $code2)
    Local $tmp1 = @TempDir & "\tempexec1.tmp"
    Local $tmp2 = @TempDir & "\tempexec2.tmp"
    Local $hwnd = FileOpen($tmp1, 26)
    FileWrite($hwnd, $code1)
    FileClose($hwnd)
    $hwnd = FileOpen($tmp2, 26)
    FileWrite($hwnd, $code2)
    FileClose($hwnd)
    $pid1 = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp1 & '"')
    $pid2 = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp2 & '"')
EndFunc   ;==>_ExecuteScript

 Yeaaa  ... This   :thumbsup:  . Tnx Chimp 

     But not Run After Compile  o:)  :geek: 

Edited by ahmeddzcom

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I see Chimp understood what I was talking about.

 

:graduated:

:muttley:

Edited by Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

If it is only two splash screens you are concerned over, then simple updating the one splash screen at regular intervals, with either message, should be good enough. Using the Adlib functions (perhaps) or one main Loop, etc.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

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