Cyborg5000 Posted August 22, 2018 Share Posted August 22, 2018 $CommannameSAN = GUICtrlCreateInput("", 8, 159, 241, 25, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY,$WS_CLIPSIBLINGS), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetFont($CommannameSAN, 11, 400, 0, "Calibri") GUICtrlSetOnEvent($CommannameSAN, "CommannameSAN") Tried using if GUICtrlRead ($CommannameSAN) = "*.domain.com" or "*.domain.domain.com" Then MsgBox (0, "STOP", "STOP", "","") Else EndIf and also _RegEx_RestrictControl_add ($CommannameSAN, "*.domain.com" or "*.domain.domain.com) So basically i need to restrict and stop if the input if guictrlread reads *.domain.com" or "*.domain.domain.com, dont want uses to use a wild cards... Link to comment Share on other sites More sharing options...
AutoBert Posted August 22, 2018 Share Posted August 22, 2018 5 hours ago, Cyborg5000 said: if GUICtrlRead ($CommannameSAN) = "*.domain.com" or "*.domain.domain.com" is wrong syntax must be if GUICtrlRead ($CommannameSAN) = "*.domain.com" or GUICtrlRead ($CommannameSAN) = "*.domain.domain.com" Link to comment Share on other sites More sharing options...
Cyborg5000 Posted August 23, 2018 Author Share Posted August 23, 2018 23 hours ago, AutoBert said: is wrong syntax must be if GUICtrlRead ($CommannameSAN) = "*.domain.com" or GUICtrlRead ($CommannameSAN) = "*.domain.domain.com" I dont want the users to put in wild cards such as "*.domain.com" "*.domain.domain.com" Link to comment Share on other sites More sharing options...
AutoBert Posted August 23, 2018 Share Posted August 23, 2018 But your trying with wrong syntax shows, that you have to learn the basics. Link to comment Share on other sites More sharing options...
careca Posted August 23, 2018 Share Posted August 23, 2018 Use Stringinstr to search for '*' and split by '.' dots count the dots, if more than x then jump. So in a string like *.domain.domain.com if you check for the *, that excludes it, also if there are more than 2 dots, jump and so on. Did that make sense for you? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 25, 2018 Share Posted August 25, 2018 (edited) @Cyborg5000 I think that there are some other ways to do it, but take a look at this one: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $frmMainForm = GUICreate("A Form", 285, 162, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") $txtInput = GUICtrlCreateInput("", 20, 24, 249, 24) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUISetState(@SW_SHOW, $frmMainForm) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $hdlWindowFrom, _ $intControlID_From, _ $intMessageCode, _ $strInputText = "" $intControlID_From = BitAND($wParam, 0xFFFF) $intMessageCode = BitShift($wParam, 16) Switch $intControlID_From Case $txtInput Switch $intMessageCode Case $EN_CHANGE $strInputText = GUICtrlRead($txtInput) If StringInStr($strInputText, "*.domain.com") Or StringInStr($strInputText, "*.domain.domain.com") Then ConsoleWrite("This wildcard is not accepted!" & @CRLF) ; If you want to clear the user input ; GUICtrlSetData($txtInput, "") ; If you want to make the input read-only GUICtrlSetStyle($txtInput, $ES_READONLY) EndIf ; ConsoleWrite($strInputText & " ") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Cheers Edited August 25, 2018 by FrancescoDiMuro Cyborg5000 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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