Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/05/2016 in all areas

  1. LarsJ

    Why #forceref?

    czardas, You are free to place #forceref where you want. You can place it like this: Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) ; ; Code ; Return $GUI_RUNDEFMSG #forceref $hWnd, $iMsg, $wParam EndFunc ;==>WM_NOTIFY This should eliminate the performance impact.
    2 points
  2. Milas, Please remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. M23
    1 point
  3. The only universal method I know is highlighting the address bar using F6 (when the browser is active). Since there is no control to get info from on any browsers F6 or Alt+d will select and highlight the url in the address bar, then you can send Ctrl+c to copy it
    1 point
  4. Then use another variable as the "counter" variable. For $iCounter = $h To 0 Step -1
    1 point
  5. Zelna, Welcome to the AutoIt forums. You need to add a start index to your For..To..Next statements: ; Now For $h To 0 Step -1 ; Required For $h = Some_Value To 0 Step -1 M23
    1 point
  6. error471, Good. Please test the new function tonight and see if that solution works for you = I think it is the best way to go. M23
    1 point
  7. There are 2 desktop's used by microsoft: The top one is what the default is for FileSelectFolder() and the actual @DesktopDir is the second shown in the image. Jos
    1 point
  8. mLipok

    Why #forceref?

    Quick test: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 Func __Snippet($vSource, $sCode) #forceref $vSource ; added latency Execute($sCode) ; $vSource may, or may not, appear in the code EndFunc Global $a[0] ConsoleWrite($a[1] & @CRLF) Compiling .... Run Exe file : error in line 7 . So it means: untouched. ps. @czardasThanks
    1 point
  9. I think these programmers might be robots. Put everything inside brackets - I say!
    1 point
  10. Jos

    Why #forceref?

    It does as that is the only way to tell it it is really used. So it's purpose in life is 2 fold but none for AutoIt3 itself, so feel free not to use it. Au3Check is using it as shown. AU3Stripper is using it to avoid a variable being stripper for not being used. Jos
    1 point
  11. 1 point
  12. This example should give you some ideas. #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Local $idListview Local $hWin = GUICreate("ListView Get Item Text Array", 400, 300) $idListview = GUICtrlCreateListView("col1|col2|col3", 2, 2, 394, 268) GUICtrlCreateListViewItem("line1|data1|more1", $idListview) GUICtrlCreateListViewItem("line2|data2|more2", $idListview) GUICtrlCreateListViewItem("line3|data3|more3", $idListview) GUICtrlCreateListViewItem("line4|data4", $idListview) GUICtrlCreateListViewItem("line5", $idListview) For $y = 6 To 30 GUICtrlCreateListViewItem("line" & $y, $idListview) Next GUISetState(@SW_SHOW) Local $aArray[_GUICtrlListView_GetItemCount($idListview) + 1][_GUICtrlListView_GetColumnCount($idListview)] For $i = 0 To UBound($aArray) - 2 For $j = 0 To UBound($aArray, 2) - 1 $aArray[$i + 1][$j] = _GUICtrlListView_GetItem($idListview, $i, $j)[3] If $aArray[$i + 1][$j] <> "" Then $aArray[0][$j] += 1 Next Next _ArrayDisplay($aArray) Local $hCtrl = ControlGetHandle($hWin, "", $idListview) MsgBox($MB_SYSTEMMODAL, "Information", "Item count in Column#1 = " & $aArray[0][0] & @LF & _ "Item count in Column#2 = " & $aArray[0][1] & @LF & _ "Item count in Column#3 = " & $aArray[0][2], 0, $hCtrl) _GUICtrlListView_Scroll($idListview, _GUICtrlListView_GetItemPositionX($idListview, 0), _GUICtrlListView_GetItemPositionY($idListview, $aArray[0][0] - 1)) MsgBox(0, "Wait", "View end of column 1", 0, $hCtrl) _GUICtrlListView_Scroll($idListview, _GUICtrlListView_GetItemPositionX($idListview, 1), _GUICtrlListView_GetItemPositionY($idListview, $aArray[0][1] - 2)) MsgBox(0, "Wait", "View end of column 2", 0, $hCtrl) _GUICtrlListView_Scroll($idListview, _GUICtrlListView_GetItemPositionX($idListview, 2), _GUICtrlListView_GetItemPositionY($idListview, $aArray[0][2] - 2)) MsgBox(0, "Wait", "View end of column 3", 0, $hCtrl) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete()
    1 point
  13. Did you try running the code and see if it works? Also, if you're going to be checking for a lot of files I'd suggest storing the file names in an array and using a for loop instead (or if your files are all named the same with an additional number you can forego the array and just use a string) ; Use an array to hold the names Local $aFiles[] = ["my file.txt", "my other file.txt", "some random file.bat", "broken script.au3", "random code.au3"] For $i = 0 to UBound($aFiles) - 1 ; Good practice to include the full path to the file, even if it's in the same directory as the script If (FileExists(@ScriptDir & "\" & $aFiles[$i])) Then If MsgBox($MB_YESNO, "Cancel file", "the file " & $aFiles[$i] & " exists .. want to delete it!") = $IDYES Then FileRecycle(@ScriptDir & "\" & $aFiles[$i]) EndIf EndIf Next ; Same concept just not using an array, works well if the files are all the same name but have sequential numbers For $i = 1 To 4 If (FileExists(@ScriptDir & "\records" & $i & ".dat")) Then If MsgBox($MB_YESNO, "Cancel file", "the file records" & $i & ".dat exists .. want to delete it!") = $IDYES Then FileRecycle(@ScriptDir & "\records" & $i & ".dat") EndIf EndIf Next
    1 point
  14. Never seen it, and I'm afraid of it. Don't use it.
    1 point
  15. I cant say I've seen that used, at least not enough that I've noticed it.
    1 point
  16. @HermiM No reason, just outdated scripts , Don't use it, It will only evaluate "string" once more (which isn't required) P.S Its AutoIt, not AutoIT!
    1 point
  17. Have you tried this? _FFXPath( "//input[@id='superbutton']") _FFCmd("FFau3.xpath.onclick()")
    1 point
  18. hi Morthawt, Here's an example showing how to do it (without deleting and recreating controls like guinness's method) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 162, 58, 216, 148) $Input2 = GUICtrlCreateInput("Input2", 8, 8, 145, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $Checkbox1 = GUICtrlCreateCheckbox("Show password", 8, 32, 145, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;Retrieve the ASCII value of the default password char $DefaultPassChar = GUICtrlSendMsg($Input2, $EM_GETPASSWORDCHAR, 0, 0) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 If (GUICtrlRead($Checkbox1) = $GUI_CHECKED) Then GUICtrlSendMsg($Input2, $EM_SETPASSWORDCHAR, 0, 0) Else GUICtrlSendMsg($Input2, $EM_SETPASSWORDCHAR, $DefaultPassChar, 0) EndIf GUICtrlSetState($Input2, $GUI_FOCUS) ;Input needs focus to redraw characters EndSwitch WEnd Hope this helps, -smartee EDIT: Moved GUICtrlSetState() out of the If-Then structure
    1 point
  19. For those of you who wish to be different. #include <GUIConstants.au3> $gui_win = GUICreate("My GUI", 320,140, @DesktopWidth/2-160, @DesktopHeight/2-45) $char = GUICtrlCreateInput ( "", 10, 5, 300, 20) $input = GUICtrlCreateInput ("", 10, 35, 300, 20,$ES_PASSWORD) $change = GUICtrlCreateButton ("Change", 40, 75, 60, 20) $nopwdchar = GUICtrlCreateButton ("No PWD Char", 40, 100, 100, 20) GUISetState () $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $change $p_char = GUICtrlRead($char) If(StringLen($p_char) == 1) Then _GUICtrlInputSetPasswordChar($input, $p_char) ControlFocus($gui_win,"",$input) EndIf Case $msg = $nopwdchar _GUICtrlInputSetPasswordChar($input, "", 0) ControlFocus($gui_win,"",$input) EndSelect Wend Func _GUICtrlInputSetPasswordChar($h_wnd, $s_char, $i_mask=1) Const $EM_SETPASSWORDCHAR = 0xCC If($i_mask) Then GUICtrlSendMsg($h_wnd,$EM_SETPASSWORDCHAR,Asc($s_char),0) Else GUICtrlSendMsg($h_wnd,$EM_SETPASSWORDCHAR,0,0) EndIf EndFunc
    1 point
×
×
  • Create New...