Surviver Posted July 6, 2010 Share Posted July 6, 2010 (edited) I have the code that you see, it works good but i have 2 questions:1)Why if i want to pass on a new line, i can't?2)On The password input for the encrypt function i want to force the user to enter minimum one character, but i want also that chars to be masked with the "*" characterHere is the code:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include<GuiEdit.au3> GUICreate("Ducky's freaky Editor", 600, 600, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) $filemenu = GUICtrlCreateMenu("Meniu") $exititem = GUICtrlCreateMenuItem("Iesire", $filemenu) $hEdit_1 = GUICtrlCreateEdit("", 10, 5, 580, 500, BitOR($WS_VSCROLL, $WS_HSCROLL)) _GUICtrlEdit_SetLimitText($hEdit_1,0) GuiCtrlCreateButton("Encrypt", 10, 520, 70, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $exititem ExitLoop Case $msg = $encrypt $passul = InputBox("Password", "Enter the password desired" & @CRLF"MINIMUM 1 caracter!!!", "", "*") $sNewtext = "" $sText = GUICtrlRead($hEdit_1) $aLines = StringSplit($sText, @CRLF, 1) For $i = 1 To $aLines[0] $sNewtext &= _StringEncrypt(0, $aLines[$i], $passul) & @CRLF Next GUICtrlSetData($hEdit_1, $sNewtext) EndSelect WEnd Sorry for the edited code but now that i have solved the problem, i edited the source for private reasons.But i have not deleted the problems in order that the others could undesrstand what was my mistakes. Edited July 6, 2010 by AutoBot Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 6, 2010 Moderators Share Posted July 6, 2010 AutoBot, Why if i want to pass on a new line, i can't?You set the Edit style to BitOR($WS_VSCROLL, $WS_HSCROLL). This overwrites the default style (which actually includes those 2 styles) and so removes the default $ES_MULTILINE style you need to create new lines. Remember that many AutoIt controls have the necessary styles built-in - look at the relevant page in the Help file to see what they are. Remember also that if you specify a particular style, you overwrite the existing style value. So if you want an additional style, you have to respecify all of the exisitng styles as well - or you end up with just the new style on its own. password input for the encrypt functionRead the Help file for InputBox: "password char - [optional] The character to replace all typed characters with in the display. If you want the actual typed character to appear, define with an empty string ("") (default) or a space for the first character." You had " M" for this parameter - the first character is a space and so, just as the help file tells you, you get the actual typed characters. If you want "*" instead, just replace the space with it: "*M". All clear? 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...
Surviver Posted July 6, 2010 Author Share Posted July 6, 2010 Clear like a clean water, thank you again, i didn't knew that i had made a mistake overwriting the stiles. Thank you again. 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