Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/16/2015 in all areas

  1. asianqueen, Just look for the combo being actioned - no need for the input or button: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> HotKeySet("{ESC}", "_Exit") $TVID = GUICreate("TVID", 331, 374, -1, -1, -1, -1) GUISetFont(12, 400, 0, "MS Sans Serif") $namelist = GUICtrlCreateCombo("", 20, 60, 290, 149, -1, 512) $bconnect = GUICtrlCreateButton("Connect To PC", 20, 255, 290, 30, -1, -1) $pwdinput = GUICtrlCreateInput("Input Password if different from default", 20, 220, 290, 28, -1, 512) $bexit = GUICtrlCreateButton("E X I T", 110, 301, 100, 57, -1, -1) GUISetState(@SW_SHOW) ;Get Items from files $file = @ScriptDir & "\TVid.ini" Dim $newvalue, $userlist, $IDs, $userlist[10], $IDs[10] $sections = IniReadSectionNames($file) If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else For $i = 1 To $sections[0] $newvalue = $newvalue & $sections[$i] & "|" Next GUICtrlSetData($namelist, StringTrimRight($newvalue, 1)) EndIf While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $bexit ; Multiple items are allowed here <<<<<< _Exit() Case $bconnect Connection() Case $namelist ; Combo actioned <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< MsgBox($MB_SYSTEMMODAL, "Username", IniRead($file, GUICtrlRead($namelist), "User", "Error")) EndSwitch WEnd Func Connection() Exit ;Erase or comment upon finished code EndFunc ;==>Connection Func _Exit() Exit EndFunc ;==>_Exit You will have to amend your ini file to use "=" rather then ":", otherwise you will need to write your own function instead of using IniRead. M23
    1 point
  2. This what you want? #include-once ; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ; #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> #include <GUIListview.au3> #include <GUIListBox.au3> HotKeySet("{ESC}", "_Exit") ;Will need to create to read it from external file $TVID = GUICreate("TVID",331,374,-1,-1,-1,-1) $nameinput = GUICtrlCreateInput("Search By Name",20,20,185,30,-1,512) GUICtrlSetFont(-1,12,400,0,"MS Sans Serif") $bsearch = GUICtrlCreateButton("Search",210,20,100,30,-1,-1) GUICtrlSetFont(-1,12,400,0,"MS Sans Serif") $namelist = GUICtrlCreateCombo("",20,60,290,149,-1,512) $bconnect = GUICtrlCreateButton("Connect To PC",20,255,290,30,-1,-1) GUICtrlSetFont(-1,12,400,0,"MS Sans Serif") $pwdinput = GUICtrlCreateInput("Input Password if different from default",20,220,290,28,-1,512) GUICtrlSetFont(-1,12,400,0,"MS Sans Serif") $bexit = GUICtrlCreateButton("E X I T",110,301,100,57,-1,-1) GUISetState(@SW_SHOW) ;Get Items from files $file = @ScriptDir & "\IDs\TVid.ini" Dim $newvalue, $userlist, $IDs, $userlist[10], $IDs[10] $sections = IniReadSectionNames($file) If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") Else For $i = 1 To $sections[0] $newvalue = $newvalue & $sections[$i] & "|" Next GUICtrlSetData($namelist, StringTrimRight($newvalue, 1)) EndIf while 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _Exit() Case $bexit _Exit() case $bconnect Connection() case $bsearch Case $namelist ConsoleWrite("Selected: " & GUICtrlRead($namelist) & @CRLF) EndSwitch WEnd Func Searcher() ;This is where I need it to find rather which item in the list is selected and then display its user name. Exit ;Erase or comment upon finished code EndFunc Func Connection() Exit ;Erase or comment upon finished code EndFunc Func _Exit() Exit EndFunc
    1 point
  3. If you know what is the silent parameter, you just have to put it in your Run/RunWait/ShellExecute/ShellExecuteWait command.Be careful with the simples quotes For example, with "setup.exe" /s : RunWait( '"setup" /s')
    1 point
  4. mLipok

    SMTP Mailer UDF

    you can try this one: inside Func _INetSmtpMailCom(.... change this: $objEmail.Send to this: _SaveMessageToFile($objEmail,@ScriptFullPath & '_BeforeSend.eml') $objEmail.Send _SaveMessageToFile($objEmail,@ScriptFullPath & '_AfterSend.eml') and of course here is _SaveMessageToFile ; #FUNCTION# ==================================================================================================================== ; Name ..........: _SaveMessageToFile ; Description ...: ; Syntax ........: _SaveMessageToFile($oMsg, $sFileFullPath) ; Parameters ....: $oMsg - An unknown value. ; $sFileFullPath - A string value. ; Return values .: None ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://msdn.microsoft.com/en-us/library/aa488396(v=exchg.65).aspx ; Example .......: No ; =============================================================================================================================== Func _SaveMessageToFile($oMsg, $sFileFullPath) Local $oStm = ObjCreate("ADODB.Stream") $oStm.Open $oStm.Type = 2 ; adTypeText $oStm.Charset = "US-ASCII" $oMsg.DataSource.SaveToObject($oStm, "_Stream") ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms676152(v=vs.85).aspx ; adSaveCreateOverWrite = 2 $oStm.SaveToFile($sFileFullPath, 2) ; CleanUp $oDsrc ='' $oStm ='' EndFunc If this is exactly what you want then I will submit new version of this UDF.
    1 point
  5. Ascend4nt and Yashied, Thank you both for your efforts. I mentioned a tutorial on this x64 compatability problem to enlighten hobbyist coders like me the last time it came up - I suppose both of you are still not interested in writing one? New UDF and example in the first post. M23
    1 point
×
×
  • Create New...