Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/25/2014 in all areas

  1. JLogan3o13

    Windows Firewall UDF

    I dug this UDF out in response to a request in the General Help forum. There is still some tidying to do, but I thought I would post here for anyone that would benefit. All functions have been tested on both XP and Windows 7. Updated January 22, 2014: Tested on XP, WIN7 and WIN8.1, x86 and x64 Current version includes: Enable or Disable the Windows Firewall Add or Remove Authorized Applications to the Exclusions list Add or Delete Ports from the Exclusions list. Enable or Disable the use of Exceptions Enable or Disable Notifications of blocked applications Enable or Disable Existing Ports List all Applications in the Exclusions List List all Ports in the Exclusions List List Properties of the current Firewall Configuration Restore the Windows Firewall to its default configuration Windows Firewall.au3
    1 point
  2. This is a little project I started knowing it was over my head to intentionally raise my own experience bar. Pretty Simple Concept and its finally working like I want it to. The Basic Idea: An exe you copy into your Snippet folder and run from there with a shortcut ( or w/out ). Top Part of GUI Get Files - Creates a ListView of all au3 file in the WorkingDir ~ >_RecFileListToArray Thanks M23 !! Clear - clears last search otherwise new search/GetFiles is appended (gets full quick) File Search - search through the WorkingDir for a Keyword ~ >_FindInFile Thanks guinness !! Far Right is a label with the Path of your Working Directory Bottom Part All of these commands work with The Selected File Path From top part: Text Search - searches though preview window for text like F3 (find next) Thanks M23 !! Open in SciTE - Duh... Preview - Shows Preview of Selected File Path in Bottom window with Syntax Hi Liting ~ >RESH Thanks Beege Throw String - Experimental, Sends Selected Text to last Cursor Position in active tab in SciTE (now works w' multiple lines) Only works with one line... >Thanks Jos, guinness Everything you need to try it is in the zip file. Constructive Critics and Suggestions are welcome ;-) Some Pics: Here you see a search for Text in File "@ScriptDir". All the files that have this in them will be listed Then search through the Preview for each instance of "@ScriptDir" until you find the one you want. SnippetBrowser1.0.zip SnippetBrowser_1.0.1.zip ~ update: 14 Dec 2013 SnippetBrowser_1.0.1.zip ~ update: 18 Dec 2013 SnippetBrowser_1.0.2.zip ~ update: 26 Dec 2013 Bill
    1 point
  3. JohnOne

    ControlSend, sourcecode?

    There are now, but there were not earlier. AutoIt is created in C++ I believe SendInput function would be used for AutoIt Send() function but I doubt it for ControlSend(), I believe it would be SendMessage, using both the WM_KEYDOWN and WM_KEYUP messages. I did make it once while learning C++ but was a couple of years ago and never really used it beyond testing as AutoIt was much simpler. How is it that you determine the shift key is "spammed"?
    1 point
  4. tomashen, You will need to use a message handler - take a look at my GUIListViewEx UDF. M23 Edit: I now see you linked to one of my scripts which uses a message handler. I would counsel against detecting single clicks on a ListView - quite often I have found them to be eaten by the control itself. I again point you to my UDF - it allows for item editing and most other things.
    1 point
  5. Perhaps you can mark the topic as solved.
    1 point
  6. It's because you have open the file in Read mode. Here is your version, with some changes to work : Func ChangeFFUseragent() Local Const $sPrefPath = "C:\Users\Jerome\AppData\Roaming\Mozilla\Firefox\Profiles\er6wwvjm.default\prefs.js" if FileExists($sPrefPath) Then ; If file not exists, exit ; Open the file for writing (append to the end of a file) and store the handle to a variable. Local $hFileOpen = FileOpen($sPrefPath, 1) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") EndIf ; Read the contents of the file using the handle returned by FileOpen. Local $sFileRead = FileRead($hFileOpen) ;Write new Useragent FileWriteLine($hFileOpen, "user_pref(""general.useragent.override"", ""Some string"");" & @CRLF) Else MsgBox(4096,"Error", " Error finding Pref.js error:" & @error) Exit EndIf EndFunc Now, if you call the ChangeFFUseragent several times, a line will be added each time. It's cleaner to add the line only if needed and the replace it if already exists. Try with this shortest code (there are two func parameters : profileDir and UserAgent string. Global $FFProfile = @UserProfileDir & "\Application Data\Mozilla\Firefox\Profiles\autoitbrowser.default" ChangeFFUseragent($FFProfile, "MyNewSuperUserAgentddd") Func ChangeFFUseragent($sPrefPath, $sUserAgent) If ProcessExists("firefox.exe") Then Return SetError(2, 0, 0) Local $sFileRead = FileRead($sPrefPath & "\prefs.js") If @error Then Return SetError(1, 0, 0) $sFileRead = StringRegExpReplace($sFileRead, '(?i)("general\.useragent\.override", ?")([^"]+)', "$1" & $sUserAgent) If NOT @extended Then $sFileRead &= @CRLF & 'user_pref("general.useragent.override", "' & $sUserAgent & '");' $hFile = FileOpen($sPrefPath & "\prefs.js", 2) If $hFile = -1 Then Return SetError(1, 0, 0) FileWrite($hFile, $sFileRead) FileClose($hFile) Return 1 EndFunc
    1 point
  7. I changed my code again, now it works better, again.. Local $sString1 = "/storage/sdcard0/test/auto-import", $sString2 = "/storage/sdcard0/test/what/ever", _ $aString1 = StringSplit($sString1, "/"), $aString2 = StringSplit($sString2, "/"), $b If UBound($aString1) <= UBound($aString2) Then Local $c = UBound($aString1) - 1 If UBound($aString1) >= UBound($aString2) Then Local $c = UBound($aString2) - 1 For $a = 1 To $c If $aString1[$a] = $aString2[$a] Then $b &= $aString1[$a] & "/" If $aString1[$a] <> $aString2[$a] Then ExitLoop Next ConsoleWrite($b & @LF)
    1 point
×
×
  • Create New...