Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/08/2013 in all areas

  1. BrewManNH

    Stop Button.

    Open the help file, navigate to the section on GUICtrlCreateButton, and look at the example script in there. It will show you how to access it.
    2 points
  2. Alright, Explanation: When I write software, I use a lot of resource files (e.g. : image files, .ini files, .properties files), and it is a time consumer to have to find those filepaths, copy and paste them, or type them out and hope for no keystroke errors. This is a resource manager that stores and displays the filepaths for the resources I plan on using in the script i'm working on. You can drag and drop all the files onto the listview in the options, click generate and it will create a _res.profile file with your script's name appended to that file so that when the tool is opened from SciTE's tools list it displays the contents of the _res.profile associated with the script that it was opened on (or hopefully it could dynamically display the _res.profile associated with teh focused tab in SciTE) When (at the main gui, not the options) you click on a file path in the list view (either by the user hitting enter, or double clicking) it will write that file path in the script where ever your cursor is, thus saving you time and repitition of tasks. Edit: Later I would revise it so that you can group the images, .ini files etc but for now just showing them all together will work
    2 points
  3. Would this be better for you? Run('setup.exe /VTRANSFORMS=\transform.mst\') Or perhaps this? Run('"setup.exe" /VTRANSFORMS="\transform.mst\"')
    1 point
  4. I'm not going to be defeated again
    1 point
  5. JLogan3o13

    Stop Button.

    3 answers in less than a minute, gotta love this forum
    1 point
  6. FireFox

    Stop Button.

    Hi, You will need to make an event on this button using the GUIGetMsg / GUICtrlSetOnEvent function. In the function you will need the ProcessClose function (if it's for another application) otherwise use the Exit statement. If you are stuck somewhere, let us know. Be sure to read the helpfile examples Edit: How fast you are guys, I leave this forum now ! Br, FireFox.
    1 point
  7. JLogan3o13

    Stop Button.

    Hi, kynkracer, welcome to the forum. You need to tell the GUI to look for action on the button. Something like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $msg GUICreate("Test", 300, 300) $stop = GUICtrlCreateButton("Stop!", 120, 60, 50, 17) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $stop Exit EndSelect WEnd GUIDelete()
    1 point
  8. "High level features" for C is questionable. BTW almost all items are questionable!
    1 point
  9. Sounds good to me. I'm fairly crunched for time, but I'll workon this as I can. Here's where I'm at so far (far from complete). #include <Array.au3> ;Testing purposes only _MountUserProfileTempRegHives() ; #FUNCTION# ==================================================================================================================== ; Name...........: _MountUserProfileTempRegHives ; Description ...: Loads User Profile NTUSER.DAT Files into HKU\Temp Hive by SID ; Syntax.........: _MountUserProfileTempRegHives( [ $Verbose, $Filter, $Mode ] ) ; Parameters ....: $Verbose - [optional] Provides Verbose Information via SetExtended ; $Filter - [optional] Specify User Profile Directories(s) ; $Mode - [optional] Filter Operation Mode ; |0 = Omit Specified User Profile(s) ; |1 = Include Specified Profiles(s) ; Return values .: Success - Returns 1 ; - Returns String containing verbose output if $Verbose = True ; Failure - Returns 0 and Sets @error: ; |0 - Failed to load User Registry Hive(s) ; - Returns String containing verbose output if $Verbose = True ; |1 - Invalid $Verbose ; |2 - Invalid $Filter ; |3 - Invalid $Mode ; Author ........: Spudw2k ; Modified.......: ; Remarks .......: ; Related .......: _GetProfileList ; Link ..........: ; Example .......: ; =============================================================================================================================== ;incomplete Func _MountUserProfileTempRegHives($Verbose = False, $Filter = "", $Mode = 0) If Not IsBool($Verbose) Then Return SetError(1, 0, 0) If Not IsString($Filter) And Not UBound($Filter) Then Return SetError(2, 0, 0) If Not ($Mode <> 0 Or $Mode <> 1) Then Return SetError(3, 0, 0) Local $arrProfileList = _GetProfileList() _ArrayDisplay($arrProfileList) EndFunc ;==>_MountUserProfileTempRegHives ; #FUNCTION# ==================================================================================================================== ; Name...........: _GetProfileList ; Description ...: Retrieves ProfileList Subkeys from Registry ; Syntax.........: _GetProfileList ; Parameters ....: ; Return values .: Success - Returns Two-Dimension Array with Profile SIDS and Profile Paths ; Failure - Returns 0 and Sets @error: ; |1 - Unable to Enumerate ProfileList Key ; Author ........: Spudw2k ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _GetProfileList() Local $arrProfileList[1][2] = [["SID", "ProfileDir"]] Local $regKeyRoot = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList" Local $idx = 1 While 1 $regProfileSID = RegEnumKey($regKeyRoot, $idx) Switch @error Case 1 Return SetError(1, 0, 0) Case -1 ExitLoop EndSwitch If Not (StringLen($regProfileSID) <= 8) Then $regProfileDir = RegRead($regKeyRoot & "\" & $regProfileSID, "ProfileImagePath") If Not @error Then $arrUbound = UBound($arrProfileList) ReDim $arrProfileList[$arrUbound + 1][2] $arrProfileList[$arrUbound][0] = $regProfileSID $arrProfileList[$arrUbound][1] = $regProfileDir EndIf EndIf $idx += 1 WEnd Return $arrProfileList EndFunc ;==>_GetProfileList ; #FUNCTION# ==================================================================================================================== ; Name...........: __RunRegLoadUnloadCMD ; Description ...: Executes context sensitive REG LOAD/UNLOAD Command ; Syntax.........: __RunRegLoadUnloadCMD( $Mode, $HivePath, [ $RegFile ] ) ; Parameters ....: $Mode - Mode of Operation ; |0 = Unload ; |1 = Load ; $HivePath - Path to the Hive Key (HKU\TempHive\SID) ; $RegFile - [optional] Required RegFile for Load Operation only. Ignore if Unload ; Return values .: Success - Returns 1 ; Failure - Returns 0 and Sets @error: ; |0 - Reg Command Failed ; |1 - Invalid $Mode ; |2 - $RegFile does not exist ; Author ........: Spudw2k ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func __RunRegLoadUnloadCMD($Mode, $HivePath, $RegFile = "") If Not ($Mode <> 0 Or $Mode <> 1) Then Return SetError(1, 0, 0) If Not FileExists($RegFile) Then Return SetError(2,0,0) Local $regCMD = @SystemDir & "\REG.EXE " Switch $Mode Case 1 $regCMD &= "LOAD " & $HivePath & " " & $RegFile Case 0 $regCMD &= "UNLOAD " & $HivePath EndSwitch ;Local $pid = Run($regCMD,@ScriptDir,@SW_HIDE,$STDERR_MERGED) ;Local $line ;While 1 ; $line &= StdoutRead($pid) ; If @error Then ExitLoop ;WEnd EndFunc I intend to create functions to write to user profiles which will allow the inclusion or ommision of "system accounts", as well as supporting functions (unmount temp userprofile hives, etc.) This is a fun exercise for me as I need to work on better documentation for my scripts. edit: added automatic filter to _GetProfileList() to omit Local Service account SIDs. Those hives are already loaded into HKU at runtime. Will still provide capability to wrtie to those hives as well as .Default but will omit by default.
    1 point
  10. Melba23

    Gui flatten buttons

    Hawkysoft, Glad I could help. The Help file should always be your first port of call - but do not hesitate to post even simple questions, we do not bite. Although do not be too surprised if you are redirected straight back to the Help file, but with a specific reference to a function that you missed when looking for yourself. And the forum search facility (at top-right) is not the best you have ever seen, but does throw up some good leads if you use it correctly. M23
    1 point
  11. TXTechie

    Detect Antivirus

    Nice! It found Symantec on Win7 (64-bit): [0]|Symantec Endpoint Protection [1]|Enabled [2]|C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\WSCSavNotifier.exe [3]|C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\Rtvscan.exe
    1 point
  12. StringSplit would do what you want, but it will put them into an array. You could use this array instead of 4 different variables, or you could assign the elements of the array to your variables if you really needed to.
    1 point
  13. Chiming in here: I dunno about everybody else but I still struggle to grasp just what this is supposed to do.
    1 point
  14. mLipok

    Detect Antivirus

    I search google and I find this '?do=embed' frameborder='0' data-embedContent>>
    1 point
  15. Edano

    Function in a For loop

    i see no reason for the variables in the loop, so why not clean that up: . func main() Local $oExcel = _ExcelBookOpen(@DesktopDir & "\test.xls", 0) Local $Number = '' Local $Email = '' Local $SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED Local $FromName = "Name" ; name from who the email was sent Local $FromAddress ; address from where the mail should come Local $ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED Local $Subject = "Userinfo" ; subject from the email - can be anything you want it to be Local $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail Local $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed Local $CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed Local $BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed Local $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" Local $Username = "******" ; username for the account used from where the mail gets sent - REQUIRED Local $Password = "********" ; password for the account used from where the mail gets sent - REQUIRED Local $IPPort = 25 ; port used for sending the mail Local $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS For $i = 1 To 10 $Number = _ExcelReadCell($oExcel, $i, 1) ; You assign to this but do nothing with it $Email = _ExcelReadCell($oExcel, $i, 2) ; You assign to this but do nothing with it $FromAddress = $Email _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl) If @error Then MsgBox(0, "Error sending message", "Unable to find specified file name.") EndIf Next EndFunc . which is, btw, about the same as what jaberwocky6669 suggested before...
    1 point
  16. mLipok

    Detect Antivirus

    Maybe You have problem with WMI ? Try This #include <Array.au3> Global Const $___WMI_WBEMFLAGFORWARDONLY = 0x20 ; Causes a forward-only enumerator to be returned. Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to 'SWbemObject.Clone_()'. Global Const $___WMI_WBEMFLAGRETURNIMMEDIATELY = 0x10 ; Causes the call to return immediately. Local $aAVInfo = _GetAVInfo() ; Local host. $error = @error $extended = @extended If Not $error Then _ArrayDisplay($aAVInfo, "$aAVInfo") Else ; Error. MsgBox(0, "ERROR!", $error & @CRLF & $extended) EndIf Func _GetAVInfo($sComputerName = ".") Local $aReturn[4] Local $oWMIService = ObjGet("winmgmts:\\" & $sComputerName & "\root\SecurityCenter2") Local $error = @error ConsoleWrite('IsObj() = ' & IsObj($oWMIService) & @CRLF) If Not $error Then Local $colItems = $oWMIService.ExecQuery("Select * From AntiVirusProduct", "WQL", $___WMI_WBEMFLAGFORWARDONLY + $___WMI_WBEMFLAGRETURNIMMEDIATELY) If IsObj($colItems) Then For $colItem In $colItems $aReturn[0] = $colItem.displayName $aReturn[1] = $colItem.productState $aReturn[2] = $colItem.pathToSignedProductExe $aReturn[3] = $colItem.pathToSignedReportingExe Next Switch StringMid(Hex($aReturn[1]), 5, 2) Case "00", "01" $aReturn[1] = "Disabled" Case "10", "11" $aReturn[1] = "Enabled" EndSwitch Else ; Error. Return SetError(2, $error) EndIf Else ; Error. Return SetError(1, $error) EndIf Return $aReturn EndFunc ;==>_GetAVInfo Post Your console message ? Do You have MsgBox Message ?
    1 point
  17. Melba23

    Gui flatten buttons

    Hawkysoft, Welcome to the AutoIt forum. You can remove the theme from the entire GUI like this: #include <GUIConstantsEx.au3> #include <Constants.au3> Global $aButton[4] DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) $hGUI = GUICreate("Test", 500, 500) For $i = 0 To 3 $aButton[$i] = GUICtrlCreateButton(" Button " & $i, 10, 10 + (50 * $i), 80, 30) Next GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $aButton[0] To $aButton[3] MsgBox($MB_SYSTEMMODAL, "Pressed", "Button " & $iMsg - $aButton[0]) EndSwitch WEnd Or you can remove the theme from each button as you create it like this: #include <GUIConstantsEx.au3> #include <Constants.au3> Global $aButton[4] $hGUI = GUICreate("Test", 500, 500) For $i = 0 To 3 $aButton[$i] = GUICtrlCreateButton(" Button " & $i, 10, 10 + (50 * $i), 80, 30) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($aButton[$i]), "wstr", 0, "wstr", 0) Next GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $aButton[0] To $aButton[3] MsgBox($MB_SYSTEMMODAL, "Pressed", "Button " & $iMsg - $aButton[0]) EndSwitch WEnd You choose. M23
    1 point
  18. I read that, they advocate this style which I have never managed to get on with if (something) { ... ... .. } I stopped reading after that
    1 point
  19. Hi, randym. I would suggest creating a thread in the General Help and Support forum (so you have more eyes on the issue). Be sure to post the code you're using, as well as a link to this thread where you got the UDF. We will do our best to assist
    1 point
  20. Sure ... I hope the OP return soon as he hasn't been online for a couple of years and this thread is only 8 years old.
    1 point
×
×
  • Create New...