ctl Posted April 23, 2012 Share Posted April 23, 2012 (edited) Could someone tell me, at least how could i creat a msgbox with a text wich i can copy it?I mean copy the text from the msgbox ? LE: I have manage to creat want i was looking for, but now i dont know how to make the text from the edit box to not erase when i hit cut, could i somehow let the edit box just with the copy option? Please help me...here is the cod: #include <GuiConstantsEx.au3> #include <AVIConstants.au3> #include <TreeViewConstants.au3> GUICreate("Sample GUI", 400, 400) GUISetIcon(@SystemDir & "mspaint.exe", 0) #NoTrayIcon Opt("MustDeclareVars", 1) LoginPassword() Func LoginPassword() Local $VarWord, $RetWord, $Pass = '1234' While 1 $RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300) Select Case @error ExitLoop Case $RetWord = '' MsgBox(0, "", "Reintrodu parola.") Case $RetWord <> $Pass MsgBox(48, "", "Parola corecta.") Case Else GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300) ExitLoop EndSelect WEnd ; GUI MESSAGE LOOP GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Edited April 23, 2012 by ctl Link to comment Share on other sites More sharing options...
ctl Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) Some help? sory for double posting... Thanks Melba23 for moving my post, hope i will get an answer, sory for the latest post Edited April 23, 2012 by ctl Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 23, 2012 Moderators Share Posted April 23, 2012 (edited) ctl,Please do not bump your posts within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually - like this. Just make your edit control read-only: GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300, $ES_READONLY) And you will need to include EditConstants.au3 at the top of your script. And as I mentioned in your other thread, be very cautious about having usernames and passwords in an AutoIt script as they will not be at all secure - even if compiled. M23 Edited April 23, 2012 by Melba23 Formatting screwed up - I hate this post editor 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 Link to comment Share on other sites More sharing options...
ctl Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) Ok, sory for the bump post, i will be more patient . Yes i know that is not secure, but i dont want it to be secure, because i will use it on my computer with my brother, and i think its more safe to keep it in the program that in a notepad, as i`m keeping it know I have make my control read-only but still having the same problem...i still can cut the user and password from the edit control, nothing changed, you could try the code and see the result. Edited April 23, 2012 by ctl Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 23, 2012 Moderators Share Posted April 23, 2012 ctl,I did try the code - or I would not have posted it. Are you saying that when you apply the $ES_READONLY style to the edit you can still cut data from it? I can certainly copy the data, but not cut it - which is what I understood you wanted to do. 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 Link to comment Share on other sites More sharing options...
ctl Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) I have attached a screen shot with my code, and the program running, i`m using windows xp sp3, if it matters.http://img217.imageshack.us/img217/6237/22862972.jpg Edited April 23, 2012 by ctl Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 23, 2012 Moderators Share Posted April 23, 2012 ctl,Do not declare $ES_READONLY as a Local variable. By doing that you will use your undefined Local variable in the function in place of the Global constant as set by the EditConstants.au3 file and your edit control does not get the read-only style set. 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 Link to comment Share on other sites More sharing options...
ctl Posted April 23, 2012 Author Share Posted April 23, 2012 Yes, you was right, now its working good, but i have another problem, lol, when i put too many accounts i cannot scroll down to see them, what should i do in this case? PS: Thanks a lot Melba23 for the help, maybe you could help me with this one too. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 23, 2012 Moderators Share Posted April 23, 2012 ctl,Look at the GUIScrollbars UDF in my sig - scrollbars with a single line of code. 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 Link to comment Share on other sites More sharing options...
ctl Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) Nice scrolbars colletion you made there, but i have some eror, so i have downloaded your scrollbars i have chosen the GUIScrollbars_Ex_Example_2, after that i copy the GUIScrollbars_Ex to my include files where is installed autoit, after that i have put this code:; Generate scrollbars - Yes, this is all you need to do!!!!!!! _GUIScrollbars_Generate($hGUI, 1000, 1000) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_RESTORE _GUIScrollbars_Restore($hGUI) Case $GUI_EVENT_MINIMIZE _GUIScrollbars_Minimize($hGUI) EndSwitch WEndinto my code, but now i get this eror http://img11.imageshack.us/img11/7349/erorx.jpgAnd this is my code with that eror, i try to declare that variable but then, the program doesent run anymore, i double click on it, but nothing happens, any sugestion?expandcollapse popup#include <guiconstantsex.au3> #include <aviconstants.au3> #include <treeviewconstants.au3> #include <editconstants.au3> #include <guiconstantsex.au3> #include "GUIScrollbars_Ex.au3" GUICreate("Sample GUI", 400, 400) GUISetIcon(@SystemDir & "mspaint.exe", 0) #NoTrayIcon Opt("MustDeclareVars", 1) LoginPassword() Func LoginPassword() Local $VarWord, $RetWord, $Pass = '1234' While 1 $RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300) Select Case @error ExitLoop Case $RetWord = '' MsgBox(0, "", "Reintrodu parola.") Case $RetWord <> $Pass MsgBox(48, "", "Parola corecta.") Case Else GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300, $ES_Readonly) _GUIScrollbars_Generate($hGUI, 1000, 1000) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_RESTORE _GUIScrollbars_Restore($hGUI) Case $GUI_EVENT_MINIMIZE _GUIScrollbars_Minimize($hGUI) EndSwitch WEnd ; GUI MESSAGE LOOP GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ExitLoop EndSelect WEnd EndFunc Edited April 23, 2012 by Melba23 Code tags added Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 23, 2012 Moderators Share Posted April 23, 2012 ctl,You need to store the handle of the GUI in a variable like this:expandcollapse popup#include <GuiConstantsEx.au3> #include <AVIConstants.au3> #include <TreeViewConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include "GUIScrollbars_Ex.au3" $hGUI = GUICreate("Sample GUI", 400, 400) ; Store the handle here <<<<<< LoginPassword() Func LoginPassword() Local $VarWord, $RetWord, $Pass = '1234' While 1 $RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300) Select Case @error ExitLoop Case $RetWord = '' MsgBox(0, "", "Reintrodu parola.") Case $RetWord <> $Pass MsgBox(48, "", "Parola corecta.") Case Else GUICtrlCreateEdit(@CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234", 50, 50, 300, 300, $ES_Readonly) _GUIScrollbars_Generate($hGUI, 1000, 1000) ; So you can use it here <<<<<<<<<<<<< ; GUI MESSAGE LOOP GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_RESTORE _GUIScrollbars_Restore($hGUI) Case $GUI_EVENT_MINIMIZE _GUIScrollbars_Minimize($hGUI) EndSwitch WEnd EndSelect WEnd EndFunc ;==>LoginPasswordThen the UDF will know which GUI you want to have the scrollbars. M23P.S. When you post code please use Code tags - put [autoit] before and [/autoit] after your posted code. 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 Link to comment Share on other sites More sharing options...
ctl Posted April 23, 2012 Author Share Posted April 23, 2012 Now i understand, but i want the scrollbar to be into my GUICtrlCreateEdit, would this be posible? because the username and password will be in the GUICtrlCreateEdit, so i need to scroll down in there. PS: Thanks for the tips, i will use the code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 24, 2012 Moderators Share Posted April 24, 2012 ctl, Then add the required styles to your edit control: #include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Sample GUI", 400, 400) LoginPassword() Func LoginPassword() Local $VarWord, $RetWord, $Pass = '1234' While 1 $RetWord = InputBox("Parola confirmata", "Introdu parola", Default, "*", 200, 100, 370, 300) Select Case @error ExitLoop Case $RetWord = '' MsgBox(0, "", "Reintrodu parola.") Case $RetWord <> $Pass MsgBox(48, "", "Parola corecta.") Case Else ; Make the text long enough to require scrollbars $sText = @CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234" & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "END" ; And add the required styles to the edit control GUICtrlCreateEdit($sText, 50, 50, 300, 100, BitOr($ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndSelect WEnd EndFunc ;==>LoginPassword You are asking a lot of very simple questions about AutoIt - have you studied the excellent tutorials that you will find here and here? You might find that they are very useful. 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 Link to comment Share on other sites More sharing options...
ctl Posted April 24, 2012 Author Share Posted April 24, 2012 Thanks again Melba23, now its just what i was looking for. No i didnt know about those tutorials, the only tutorials i did make was the 4 tutorials in the autoit help, i was looking for some tutorials, thanks, i will take a look on what you sent me. Thanks for all your help, and sory for the spam thread, and if you could let this thread open so if i would have some question about this program i`m creating, to post here. Link to comment Share on other sites More sharing options...
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