Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/16/2014 in all areas

  1. 2 points
  2. ripdad

    _ComputerGetSoftware

    Several years ago, June of 2010, I modified this function by >JSThePatriot, and then made a small utility of it, called: InstalledSoftwareViewer.au3 Recently, I revisited that function, and came up with this: ; Last Updated: April 17, 2014 #RequireAdmin #include 'array.au3' Local $a = _ComputerGetSoftware() If Not @error Then _ArrayDisplay($a) EndIf Exit ;=============================================== ; #FUNCTION _ComputerGetSoftware() ; Author: JSThePatriot ; http://www.autoitscript.com/forum/topic/29404-computer-info-udfs/?hl=%20_computergetsoftware ; ; Modified by ripdad: April 15, 2014 ; ; Remarks: ; Last two columns are bits (0 or 1). ; Blank Fields = no value found ;=============================================== Func _ComputerGetSoftware() Switch @OSArch Case 'X64' Local $sHKCU = 'HKEY_CURRENT_USER64', $sHKLM = 'HKEY_LOCAL_MACHINE64' Local $sSubKey1 = '\Software\Microsoft\Windows\CurrentVersion\Uninstall' Local $sSubKey2 = '\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' Local $aKeys[4] = [3, $sHKCU & $sSubKey1, $sHKLM & $sSubKey1, $sHKLM & $sSubKey2] Case 'X86' Local $sHKCU = 'HKEY_CURRENT_USER', $sHKLM = 'HKEY_LOCAL_MACHINE' Local $sSubKey = '\Software\Microsoft\Windows\CurrentVersion\Uninstall' Local $aKeys[3] = [2, $sHKCU & $sSubKey, $sHKLM & $sSubKey] Case Else Return SetError(1) EndSwitch Local $array[5001][7] = [[5000, 'DisplayVersion', 'Publisher', 'UninstallString', 'InstallDate', 'MSI', 'NoRemove']] Local $sAppKey, $sDisplayName, $sKey, $UnInstKey, $index = 0 For $i = 1 To $aKeys[0] $sKey = $aKeys[$i] For $j = 1 To $array[0][0] $sAppKey = RegEnumKey($sKey, $j) If @error Then ExitLoop $UnInstKey = $sKey & '\' & $sAppKey $sDisplayName = RegRead($UnInstKey, 'DisplayName') Select Case @error Case Not StringLen(StringStripWS($sDisplayName, 8)) Case StringRegExp($sDisplayName, '(?i)(KB\d+)') Case RegRead($UnInstKey, 'SystemComponent') Case RegRead($UnInstKey, 'ParentKeyName') Case Else $index += 1 $array[$index][0] = StringStripWS(StringReplace($sDisplayName, ' (remove only)', ''), 3) $array[$index][1] = StringStripWS(RegRead($UnInstKey, 'DisplayVersion'), 3) $array[$index][2] = StringStripWS(RegRead($UnInstKey, 'Publisher'), 3) $array[$index][3] = StringStripWS(RegRead($UnInstKey, 'UninstallString'), 3) $array[$index][4] = StringStripWS(RegRead($UnInstKey, 'InstallDate'), 3) $array[$index][5] = StringStripWS(RegRead($UnInstKey, 'WindowsInstaller'), 3) = 1 $array[$index][6] = StringStripWS(RegRead($UnInstKey, 'NoRemove'), 3) = 1 EndSelect Next Next ReDim $array[$index + 1][7] $array[0][0] = $index _ArraySort($array, 0, 1) Return $array EndFunc In the previous versions, HKCU was not checked for uninstalls. I decided to run a test, using that key, and what do you know... Five more entries were found! So, I decided to run some other test's, and found some more! Imagine that! Well anyways, this script, should cover most of them. If you have any questions - please let me know.
    1 point
  3. Mat

    AutoIt v3.3.11.4 Beta

    Backwards compatibility is always a consideration, especially if other standard UDFs rely on the behaviour. These changes aren't just made whimsically. You see one line in a change log, I see a 5 page discussion about changes to the array UDF as well as the 2 page one here in developer chat, in addition to numerous personal messages and other posts in the open forum about these changes.
    1 point
  4. Bert

    Unzip files ... (HELP)

    No. We teach you to fish, not give you fish. If we just give you fish, then you do not learn anything. Stop being lazy and learn. This is NOT hard. It is rather simple. 7-zip supports command line and you could also use PKzip/PKunzip that also supports command line.
    1 point
  5. http://autoit-script.ru/index.php/topic,12724.15.html #include <WinAPI.au3> #include <Array.au3> $hGui = GUICreate('Test', 400, 300) $iListView = GUICtrlCreateListView('Line |Data', 2, 2, 394, 268) ; $iListView = GUICtrlCreateListView('Line', 2, 2, 394, 268) $hListView = GUICtrlGetHandle(-1) ; $hListView = $iListView For $i = 1 To 1000 GUICtrlCreateListViewItem('Line ' & $i & '|' & Random(1000, 9999, 1), $iListView) ; GUICtrlCreateListViewItem('Line '&$i, $iListView) Next GUISetState() $hTimer = TimerInit() $aReturn = _GUICtrlListView_GetAllTextToArray($hListView) $extended = @extended If @error < 0 Then Exit MsgBox(0, 'Message', 'List empty') $sTime = Round(TimerDiff($hTimer)) & ' ms' ; MsgBox(262144, 'Information', _ ; "Items: " & _WinAPI_LoWord($extended) & @LF & _ ; "Columns: " & _WinAPI_HiWord($extended)) _ArrayDisplay($aReturn, $sTime) Func _GUICtrlListView_GetAllTextToArray($hListView) If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If Not IsHWnd($hListView) Then Return SetError(1, 0, 0) EndIf Local $hWin, $iItems, $iSubitems $hWin = _WinAPI_GetParent($hListView) If Not $hWin Then Return SetError(2, 0, 0) $iItems = ControlListView($hWin, '', $hListView, 'GetItemCount') If Not $iItems Then Return SetError(-1, 0, 0) $iSubitems = ControlListView($hWin, '', $hListView, 'GetSubItemCount') ; If Not $iSubitems Then Return SetError(-2, 0, 0) If Not $iSubitems Then $iSubitems = 1 Local $aReturn[$iItems][$iSubitems] = [[$iItems]] ; For $i = 0 To $iItems - 1 ; For $j = 0 To $iSubitems - 1 ; $aReturn[$i][$j] = ControlListView($hWin, '', $hListView, 'GetText', $i, $j) ; Next ; Next For $j = 0 To $iSubitems - 1 For $i = 0 To $iItems - 1 $aReturn[$i][$j] = ControlListView($hWin, '', $hListView, 'GetText', $i, $j) Next Next Return SetError(0, _WinAPI_MakeLong($iItems, $iSubitems), $aReturn) EndFunc ;==>_GUICtrlListView_GetAllTextToArray
    1 point
  6. You could write a Function for example Func RegDeleteBoth(...) RegDelete(...) StringReplace the first "/" to 64"/" RegDelete(replaced string) EndFunc So that can make you coding easier
    1 point
  7. xan

    Pac Man Matrix

    https://www.dropbox.com/s/x3qlqwvhzk06kmn/Pac-man.rar #include <misc.au3> #include <Sound.au3> Dim $map[18][27] =[["x","X","X","X","X","X","X","X","X","X","x","X","X","n","X","X","x","X","X","X","X","X","X","X","X","X","x"], _ ["x","n"," "," "," "," "," "," ","n","n","x"," "," "," "," ","n","x","n","n"," "," "," "," "," "," ","n","x"], _ ["x","o","X","X","n","x","n","X","X","n","X","n","X","X","X","n","X","n","X","X","n","x","n","X","X","o","x"], _ ["x","n"," "," "," ","x","n"," "," "," "," ","n"," ","n"," ","n"," "," "," "," ","n","x"," "," "," ","n","x"], _ ["x","X","X","n","X","X","n","X","X","X","x","n","X","X","X","n","x","X","X","X","n","X","X","n","X","X","x"], _ ["x","n"," "," "," "," "," "," "," ","n","x","n","x","n","x","n","x","n"," "," "," "," "," "," "," ","n","x"], _ ["x","n","X","X","n","x","n","X","X","n","X","n","X","X","X","n","X","n","X","X","n","x","n","X","X","n","x"], _ ["x","n"," "," "," ","x","n"," "," "," "," ","n"," ","n"," ","n"," "," "," "," ","n","x"," "," "," ","n","x"], _ ["x","X","X","n","X","X","n","X","X","X","x","n","X","X","X","n","x","X","X","X","n","X","X","n","X","X","x"], _ ["x","n"," "," "," "," "," "," "," ","n","x","n"," "," "," ","n","x","n"," "," "," "," "," "," "," ","n","x"], _ ["x","n","X","X","n","x","n","X","X","n","X","n","X","X","X","n","X","n","X","X","n","x","n","X","X","n","x"], _ ["x","n"," "," "," ","x","n"," "," "," "," ","n"," ","n"," ","n"," "," "," "," ","n","x"," "," "," ","n","x"], _ ["x","X","X","n","X","X","n","X","X","X","x","n","X","X","X","n","x","X","X","X","n","X","X","n","X","X","x"], _ ["x","n"," "," "," "," "," "," "," ","n","x"," "," ","n"," ","n","x","n"," "," "," "," "," "," "," ","n","x"], _ ["x","o","X","X","n","x","n","X","X","n","X","n","X","X","X","n","X","n","X","X","n","x","n","X","X","o","x"], _ ["x","n"," "," "," ","x","n"," "," "," "," ","n"," ","n"," ","n"," "," "," "," ","n","x"," "," "," ","n","x"], _ ["X","X","X","X","X","X","X","X","X","X","X","X","X","n","X","X","X","X","X","X","X","X","X","X","X","X","X"]] Local $vida = 2, $dir = 3, $posx = 390, $posy = 390, $pilu[18][27], $ponto[18][27], $dirAnterior, $pontos, $return[4], $fan[16], _ $fx[4], $fy[4], $rand[4], $fanDir[4], $trinta[4], $mem[4], $Tanima, $sort[4], $morto, $gameOver, $color, $Tpower, $Tcaixa, _ $cx = 390, $cy = 210, $form = GUICreate("Pac Man", 799, 590, 107, 18), $dll = DllOpen("user32.dll"), $B[3] LerMapa() $map[5][14]="n" GUISetBkColor(0x5a4ade) $B0 = GUICtrlCreateButton("", -2, 500, 805, 18) GUICtrlSetBkColor(-1, 0x1A1A1A) GUICtrlSetState(-1, 128) $B2 = GUICtrlCreateLabel("0", -2, 517, 803, 29,1) GUICtrlSetBkColor(-1, 0x008000) GUICtrlSetFont(-1, 24, 800, 20, "Atari Small") $B1= GUICtrlCreateButton("", -2, 544, 803, 50) GUICtrlSetBkColor(-1, 0x1A1A1A) GUICtrlSetState(-1, 128) $caixa=GUICtrlCreatePic("Imagens/caixa.bmp", 385, -200, 40, 33) For $i = 0 To 3 Step 1 if $i < 3 Then $B[$i] = GUICtrlCreateButton("", 40 * $i + 40, 560, 22, 24, 131072) GUICtrlSetBkColor(-1, 0x008000) GUICtrlSetState(-1, 128) $Fan[$i] = GUICtrlCreatePic("Imagens/fan" & $i & "0.bmp", 390, 135, 30, 43) Next $pac = GUICtrlCreatePic("Imagens/pac2.bmp", 390, 376, 30, 43) GUISetState() Sleep(1000) SoundPlay("Sounds/inicia.mp3",1) Restart() HotKeySet("{esc}", "Sair") AnimaPac(2) While 1 $color += 1 $Tcaixa += 1 $Tanima += 1 If $Tpower Then $Tpower -= 1 If $color > 51 Then $color = 0 If $Tcaixa > 100 Then $Tcaixa = 0 $cy = -210 GUICtrlSetPos($caixa, 385, -200) EndIf If $gameOver Then GUICtrlDelete($pac) $posx = 390 If $color > 50 Then GUISetBkColor(0x00441*$fx[0]) EndIf For $i = 0 To 3 Step 1 If Not $trinta[$i] Then $return[$i] = 1 While $return[$i] $return[$i] = 0 Switch $rand[$i] Case 0 If $map[$fy[$i]/30][$fx[$i]/30+1] <> "X" Then $fanDir[$i] = 0 ;> Else $return[$i] = 1 EndIf Case 1 If $map[$fy[$i]/30][$fx[$i]/30-1] <> "X" Then $fanDir[$i] = 1 ;< Else $return[$i] = 1 EndIf Case 2 If $map[$fy[$i]/30+1][$fx[$i]/30] <> "X" Then $fanDir[$i] = 2 ;V Else $return[$i] = 1 EndIf Case 3 If $fy[$i] <= 0 Then $fy[$i] = 510 If $map[$fy[$i]/30-1][$fx[$i]/30] <> "X" Then $fanDir[$i] = 3 ;^ Else $return[$i] = 1 EndIf EndSwitch If $return[$i] Then Sort($i) WEnd Else $mem[$i] = $fanDir[$i] EndIf If $fanDir[$i] = 0 Then $fx[$i] += 15 $trinta[$i] += 15 EndIf If $fanDir[$i] = 1 Then $fx[$i] -=15 $trinta[$i] +=15 EndIf If $fanDir[$i] = 2 Then $fy[$i] +=15 $trinta[$i] +=15 EndIf If $fanDir[$i] = 3 Then $fy[$i] -=15 $trinta[$i] +=15 EndIf If $fy[$i] > 508 And $fanDir[$i] = 2 Then $fy[$i] = 0 If $fy[$i] <= 0 And $fanDir[$i] = 1 Then $fy[$i] = 510 If Not $morto Then GUICtrlSetPos($fan[$i], $fx[$i], $fy[$i]-15) If $trinta[$i] > 20 Then $fanDir[$i] = 4 $trinta[$i] = 0 EndIf Sort($i) if $fx[$i] + 30 >= $posx And $fx[$i] <= $posx + 30 And $fy[$i] + 30 >= $posy And $fy[$i] <= $posy + 30 And Not $gameOver Then If $Tpower Then SoundPlay("Sounds/fantdie.mp3") Else $morto = 1 EndIf EndIf Next If $morto Then Restart() Else If $Tanima > 4 Then $Tanima = 0 If $posy > 508 And $dir = 3 Then $posy = -30 if $posy <= 0 And $dir = 1 Then $posy = 540 $pt = $pontos if $dir = 0 Or $dir = 2 Then $dirAnterior = $dir If GUIGetMsg( ) =-3 Then Exit If Not $gameOver Then If _IsPressed("25", $dll) And $map[$posy/30 ][$posx/30-1] <> "x" Then $dir = 0 ; < If _IsPressed("26", $dll) Then if $posy > 0 Then If $map[$posy/30-1][$posx/30 ] <> "x" Then $dir = 1 ; ^ EndIf EndIf If _IsPressed("27", $dll) And $map[$posy/30 ][$posx/30+1] <> "x" Then $dir = 2 ; > If _IsPressed("28", $dll) And $map[$posy/30+1][$posx/30 ] <> "x" Then $dir = 3 ; v EndIf If $dir == 1 Then if $posy > 0 Then If $map[$posy/30-1][$posx/30 ] == "o" Then $map[$posy/30-1][$posx/30] = "n" GUICtrlDelete($pilu[$posy/30-1][$posx/30]) $pontos +=5 $Tpower = 50 _SoundPlay("Sounds/pilula.mp3") ElseIf $map[$posy/30-1][$posx/30] == " " Then GUICtrlDelete($ponto[$posy/30-1][$posx/30]) $map[$posy/30-1][$posx/30] = "n" $pontos +=1 SoundPlay("Sounds/ponto.mp3") EndIf EndIf EndIf If $dir == 3 Then If $map[$posy/30+1][$posx/30] == "o" Then $map[$posy/30+1][$posx/30] = "n" GUICtrlDelete($pilu[$posy/30+1][$posx/30]) $pontos +=5 $Tpower = 50 _SoundPlay("Sounds/pilula.mp3") ElseIf $map[$posy/30+1][$posx/30] == " " Then GUICtrlDelete($ponto[$posy/30+1][$posx/30]) $map[$posy/30+1][$posx/30] = "n" $pontos +=1 SoundPlay("Sounds/ponto.mp3") EndIf EndIf If $dir == 0 Then If $map[$posy/30][$posx/30-1] == " " Then $map[$posy/30][$posx/30-1] = "n" GUICtrlDelete($ponto[$posy/30][$posx/30-1]) $pontos +=1 SoundPlay("Sounds/ponto.mp3") ElseIf $posx + 30 >= $cx And $posx <= $cx + 30 And $posy = $cy Then $cy = -200 $pontos += 100 _SoundPlay("Sounds/caixa.mp3") GUICtrlSetPos($caixa, $cx, $cy+10) $Tcaixa = 0 EndIf EndIf If $dir == 2 Then If $map[$posy/30][$posx/30+1] == " " Then $map[$posy/30][$posx/30+1] = "n" GUICtrlDelete($ponto[$posy/30][$posx/30+1]) $pontos +=1 SoundPlay("Sounds/ponto.mp3") ElseIf $posx + 30 >= $cx And $posx <= $cx + 30 And $posy = $cy Then $cy = -200 $pontos += 100 _SoundPlay("Sounds/caixa.mp3") GUICtrlSetPos($caixa, $cx, $cy+10) $Tcaixa = 0 EndIf EndIf If $Tcaixa > 50 Then $cy = 210 GUICtrlSetPos($caixa,$cx-5, $cy-10) EndIf If $dir = 0 And $map[$posy/30 ][$posx/30-1] <> "x" Then $posx -= 30 If $dir = 1 Then If $posy > 0 And $map[$posy/30-1][$posx/30 ] <> "x" Then $posy -= 30 ElseIf $posy <=0 Then $posy -= 30 EndIf EndIf If $dir = 2 And $map[$posy/30 ][$posx/30+1] <> "x" Then $posx += 30 If $dir = 3 And $map[$posy/30+1][$posx/30 ] <> "x" Then $posy += 30 If Not $morto Then GUICtrlSetPos($pac,$posx,$posy-14) If $pontos > $pt Then GUICtrlSetData($B2,$pontos) If $dir = 0 Or $dir = 2 And $mem <> $fanDir then AnimaPac($dir) ElseIf $mem <> $fanDir then AnimaPac($dirAnterior) EndIf If $i > 2 Then $map[5][14]="x" EndIf WEnd Func Restart() if $morto Then $vida -=1 SoundPlay("Sounds/morre.mp3") EndIf GUICtrlSetImage($pac,"Imagens/pac5.bmp") For $i = 0 To 3 Step 1 $fy[$i] = 150 $fx[$i] = 390 $return[$i] = 0 $trinta[$i] = 0 $mem[$i] = 0 $rand[$i] = 0 $sort[$i] = 1 if $morto Then Sleep(400) GUICtrlSetImage($pac,"Imagens/pac" & $i+6 & ".bmp") EndIf Next If $vida < 0 Then GUICtrlDelete($pac) $gameOver = 1 GUICtrlDelete($B[0]) GUICtrlSetData($B1, " Autoit") GUICtrlSetFont($B1, 24) EndIf For $i = 0 To 3 Step 1 GUICtrlSetPos($Fan[$i],390, 135) Next Sleep(300) if Not $gameOver Then GUICtrlSetImage($pac,"Imagens/pac0.bmp") $posx = 390 $posy = 390 GUICtrlSetPos($pac,$posx,$posy-14) $dir = 0 $map[5][14]="n" if $morto Then if $vida = 1 Then GUICtrlDelete($B[2]) If $vida = 0 Then GUICtrlDelete($B[1]) Sleep(1000) If Not $gameOver Then SoundPlay("Sounds/inicia.mp3",1) EndIf $morto = 0 EndFunc Func AnimaPac($face) If $Tanima = 0 Then For $i=0 To 3 Step 1 If Not $Tpower Then GUICtrlSetImage($Fan[$i],"Imagens/fan" & $i & "0.bmp") Next EndIf If $Tanima = 1 Then if $face = 0 Then GUICtrlSetImage($pac,"Imagens/pac4.bmp") ElseIf $face = 2 Then GUICtrlSetImage($pac,"Imagens/pac5.bmp") EndIf GUICtrlSetImage($pilu[2][1],"Imagens/zero.bmp") GUICtrlSetImage($pilu[2][25],"Imagens/zero.bmp") GUICtrlSetImage($pilu[14][25],"Imagens/zero.bmp") GUICtrlSetImage($pilu[14][1],"Imagens/zero.bmp") For $i=0 To 3 Step 1 If $Tpower < 25 Then GUICtrlSetImage($Fan[$i],"Imagens/fan" & $i & "1.bmp") Next EndIf If $Tanima = 2 Then For $i=0 To 3 Step 1 If Not $Tpower Then GUICtrlSetImage($Fan[$i],"Imagens/fan" & $i & "2.bmp") If $Tpower Then GUICtrlSetImage($Fan[$i],"Imagens/fan.bmp") Next EndIf If $Tanima = 3 Then For $i=0 To 3 Step 1 If $Tpower < 10 Then GUICtrlSetImage($Fan[$i],"Imagens/fan" & $i & "3.bmp") Next GUICtrlSetImage($pilu[2][1] ,"Imagens/pilula.bmp") GUICtrlSetImage($pilu[2][25] ,"Imagens/pilula.bmp") GUICtrlSetImage($pilu[14][25],"Imagens/pilula.bmp") GUICtrlSetImage($pilu[14][1] ,"Imagens/pilula.bmp") if $face = 0 Then GUICtrlSetImage($pac,"Imagens/pac0.bmp") ElseIf $face = 2 Then GUICtrlSetImage($pac,"Imagens/pac2.bmp") EndIf EndIf Sleep(130) EndFunc Func LerMapa() $gameOver = 0 For $i=0 To 26 Step 1 For $j=0 To 17 Step 1 If $map[$j][$i] == "X" Then GUICtrlCreatePic("Imagens/tijolo.bmp",$i*30,$j*30,30,15) ElseIf $map[$j][$i] = "x" Then If $j < 6 And $j > 4 And $i < 15 And $i > 13 Then GUICtrlCreatePic("Imagens/tijolo.bmp",$i*30+10,$j*30-15,20,60) ElseIf $j < 6 And $j > 4 And $i < 13 And $i > 11 Then GUICtrlCreatePic("Imagens/tijolo.bmp",$i*30,$j*30-15,20,60) Else GUICtrlCreatePic("Imagens/tijolo.bmp",$i*30,$j*30,30,30) EndIf ElseIf $map[$j][$i] = "o" Then $pilu[$j][$i] = GUICtrlCreatePic("Imagens/pilula.bmp",$i*30+4,$j*30-3,20,20) ElseIf $map[$j][$i] = " " Then $ponto[$j][$i]= GUICtrlCreatePic("Imagens/ponto.bmp",$i*32-20,$j*30+5,20,8) EndIf Next Next EndFunc Func Sair() DllClose($dll) Exit EndFunc Func Sort($si) Dim $aux[4] $aux[$si] = 1 While $aux[$si] $aux[$si] = 0 $rand[$si] = Random(0,3,1) If $mem[$si] = 0 Then if $rand[$si] = 1 Then $aux[$si] = 1 ElseIf $mem[$si] = 1 Then if $rand[$si] = 0 Then $aux[$si] = 1 ElseIf $mem[$si] = 2 Then if $rand[$si] = 3 Then $aux[$si] = 1 ElseIf $mem[$si] = 3 Then if $rand[$si] = 2 Then $aux[$si] = 1 EndIf WEnd EndFunc
    1 point
  8. Also this : Registry Keys Affected by WOW64 from MSDN. (HKCUSoftware root is not concerned by the redirection)
    1 point
  9. You can use WinSetState and @SW_SHOWNOACTIVATE to show the window but not make it active, it might work but no guarantees that it would be possible considering you're taking screenshots of a window, but trying to still use the other windows in the background.
    1 point
  10. This deletes from the first "." in each paragraph to the end of the paragraph. #include <Word.au3> Global $oWord = _Word_Create() If @error <> 0 Then Exit MsgBox(16, "Word UDF: _Word_DocFind Example", "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Global $oDoc = _Word_DocOpen($oWord, "Test Leerzeichen.docx", Default, Default, True) If @error <> 0 Then Exit MsgBox(16, "Word UDF: _Word_DocFind Example", "Error opening 'Test Leerzeichen.docx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oRangeFound, $oRangeText $oRangeFound = _Word_DocFind($oDoc, ".", 0) ; Search the whole document If @error Then Exit MsgBox(16, "Word UDF: _Word_DocFind Example 3", "Error locating the specified text in the document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Create a new range (duplicate to not alter the result of the find operating) $oRangeText = $oRangeFound.Duplicate $oRangeText = _Word_DocRangeSet($oDoc, $oRangeText, $WdCharacter, 1, $wdParagraph, 1) ; Move the start of the range past the "." and the end of range to the end of the paragraph $oRangeText = _Word_DocRangeSet($oDoc, $oRangeText, Default, Default, $wdCharacter, -1) ; Move the end of the range one character to the left to not delete the new line character $oRangeText.Text = "" While 1 $oRangeFound = _Word_DocFind($oDoc, ".", 0, $oRangeFound) ; Search the next "." If @error Then ExitLoop $oRangeText = $oRangeFound.Duplicate $oRangeText = _Word_DocRangeSet($oDoc, $oRangeText, $WdCharacter, 1, $wdParagraph, 1) $oRangeText = _Word_DocRangeSet($oDoc, $oRangeText, Default, Default, $wdCharacter, -1) $oRangeText.Text = "" WEnd
    1 point
  11. If the key/value in question is in both hives (64-bit and 32-bit), then yes you have to call RegDelete twice. Are you running 64-bit AutoIt or 32-bit? What key/value are you trying to delete?
    1 point
×
×
  • Create New...