TarwadaC4 Posted November 17, 2011 Posted November 17, 2011 Hello all im Wondering about how to Display two MSG Boxes at Once ? if i Wrote : MsgBox(0, "Test", "Hello") MsgBox(0, "Test", "Hello") The First Message Will Display and if we pressed ok the other will show i want to have a code that Display the two Messages at once
Moderators Melba23 Posted November 17, 2011 Moderators Posted November 17, 2011 TarwadaC4, Welcome to the AutoIt forum. You could use Yashied's NotifyBox UDF. Or code it yourself something like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hButton = GUICtrlCreateButton("Show", 10, 10, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton _Double_Box() EndSwitch WEnd Func _Double_Box() $iCount = 2 $hBox_1 = GUICreate("MsgBox 1", 200, 200, 100, 100, BitOR($WS_POPUPWINDOW, $WS_CAPTION)) $hButton_1 = GUICtrlCreateButton("OK", 10, 10, 80, 30) GUISetState() $hBox_2 = GUICreate("MsgBox 2", 200, 200, 100, 400, BitOR($WS_POPUPWINDOW, $WS_CAPTION)) $hButton_2 = GUICtrlCreateButton("OK", 10, 10, 80, 30) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hBox_1 Switch $aMsg[0] Case $GUI_EVENT_CLOSE, $hButton_1 GUIDelete($hBox_1) $iCount -= 1 EndSwitch Case $hBox_2 Switch $aMsg[0] Case $GUI_EVENT_CLOSE, $hButton_2 GUIDelete($hBox_2) $iCount -= 1 EndSwitch EndSwitch If $iCount = 0 Then Return WEnd EndFunc Try to understand how it works. Please ask questions if you do not. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
TarwadaC4 Posted November 17, 2011 Author Posted November 17, 2011 this is Display two Forms not message boxes .... ok i have another question, if i want my script to repeat the "Space" button 10 times if i pressed Space how the code Could be ? Sorry im new to this language and i like it so so much
czardas Posted November 17, 2011 Posted November 17, 2011 (edited) You can hit the space key 10 times For $i = 0 To 9 Send("{SPACE}") Next Or it could be better to send ten spaces as a string, depending on the purpose. #include <String.au3> Dim $string = _StringRepeat(" ", 10) Send($string) Edited November 17, 2011 by czardas operator64 ArrayWorkshop
TarwadaC4 Posted November 17, 2011 Author Posted November 17, 2011 But this Code will only Send Space 10 times i want it to Repeat the Space button if i Pressed on SPACE Button
czardas Posted November 17, 2011 Posted November 17, 2011 Ah, you want to go into hyperspace. Yes I can tell you how to do that, but first tell me what kind of a script needs to have simultaneous messages and hyperspace. plz operator64 ArrayWorkshop
TarwadaC4 Posted November 17, 2011 Author Posted November 17, 2011 LOL i asked for the two messages Script cuz i want to know how to do it ( i will use it but not with message boxes ) the Other Script is For Gaming
Moderators Melba23 Posted November 17, 2011 Moderators Posted November 17, 2011 TarwadaC4, im new hereSo new that you have obviously not yet had time to read the Forum Rules. If you do so now you will see that we do not support any scripts to do with gaming - so do not expect any more help on that part of the thread. i want to learnGood! Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. Have fun learning to code with AutoIt - but remember, no games-related scripts in the future! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
czardas Posted November 17, 2011 Posted November 17, 2011 (edited) It's very important that you read the forum rules. Discussion about gaming or posting scripts for gaming is not accepted here.http://www.autoitscript.com/forum/forum-2/announcement-13-forum-rules/Stick to the message boxes and you will be fine. I won't report this, but please follow the rules.EditAh Melba got there first. Edited November 17, 2011 by czardas operator64 ArrayWorkshop
TarwadaC4 Posted November 17, 2011 Author Posted November 17, 2011 (edited) no gaming here... ok thank you anyway...... Edited November 17, 2011 by TarwadaC4
czardas Posted November 17, 2011 Posted November 17, 2011 About the message boxes. You need to create them like Melba showed. You can resize and add all the buttons you want to make them look more like a message box. Check out GUICreate in the help file and look at examples on the forum also. operator64 ArrayWorkshop
TarwadaC4 Posted November 17, 2011 Author Posted November 17, 2011 got it, thank you sorry about my questions ok im using Koda now how can display a message box (For example) if i clicked on button ?
czardas Posted November 17, 2011 Posted November 17, 2011 #include <GUIConstants.au3> Example() ; Run the example Func Example() ; Example of a basic function Local $hGUI = GUICreate("Test Button", 200, 150) ; Create GUI Local $hBtn = GUICtrlCreateButton("Click Me", 10, 10) ; Create button GUISetState() While 1 $msg = GUIGetMsg() ; Get messages sent to the GUI If $msg = $GUI_EVENT_CLOSE Then ExitLoop ; Exiting the loop here terminates all commands If $msg = $hBtn Then MsgBox(0, "Info", "You clicked the button") WEnd EndFunc operator64 ArrayWorkshop
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now