Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/18/2020 in all areas

  1. Subz

    Cmd to autoit conversion

    Hidden mode (although doesn't always work with $STDOUT_CHILD) $pid = RunWait(@ComSpec & " /C " & $iC & $Commandline2, "", @SW_HIDE, $STDOUT_CHILD) This will return the text left of " (" $out = StringLeft($out, StringInStr($out, " (", 0, 1) - 1)
    1 point
  2. You can do it so: #include <WinAPI.au3> #include <WindowsConstants.au3> HotKeySet('^+q', '_Exit') ; Ctrl+Shift+Q OnAutoItExitRegister('OnAutoItExit') Global Const $HC_ACTION = 0 Global $hStub_MouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam") Global $hmod = _WinAPI_GetModuleHandle(0) Global $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_MouseProc), $hmod) ToolTip(StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC) , 100, 100, 'TOOLTIP - TIME', 1, 1) Global $tTip = _GetRectTip() Global $bClick = False AdlibRegister("_ToolTipRefresh", 1000) While True If $bClick Then $bClick = False ConsoleWrite('Tip was clicked' & @CRLF) EndIf Sleep(100) WEnd Func _Exit() Exit EndFunc Func OnAutoItExit() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_MouseProc) EndFunc Func _ToolTipRefresh() ToolTip(StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC) , 100, 100, 'TOOLTIP - TIME', 1, 1) EndFunc Func _GetRectTip() Local $hTip = WinGetHandle('[CLASS:tooltips_class32]') Local $aPos = WinGetPos($hTip) Local $tRECT = DllStructCreate("int Left;int Top;int Right;int Bottom") DllCall("user32", 'long', 'SetRect', 'ptr', DllStructGetPtr($tRECT), 'long', $aPos[0], 'long', $aPos[1], 'long', $aPos[0]+$aPos[2], 'long', $aPos[1]+$aPos[3]) Return $tRECT EndFunc Func _MouseProc($nCode, $wParam, $lParam) Local $info = DllStructCreate("int X;int Y;dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) If $nCode = $HC_ACTION Then Switch $wParam Case $WM_LBUTTONDOWN If _WinAPI_CoordInRect($tTIP, $info.X, $info.Y) Then $bClick = True EndSwitch EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc Func _WinAPI_CoordInRect(ByRef $tRECT, $X, $Y) If Not IsDllStruct($tRECT) Then Return SetError(1,0,0) Local $ret = DllCall("user32", "long", "PtInRect", "ptr", DllStructGetPtr($tRECT), "long", $X, "long", $Y) If @error > 0 Then Return SetError(2,@error,0) If $ret[0] Then Return True Else Return False EndIf EndFunc
    1 point
  3. Thank you guys. You've been a great help. 😁
    1 point
  4. Something like this : #include <Array.au3> Const $NUMBER_OF_FILES = 3 Local $aArray[0] For $i = 1 to $NUMBER_OF_FILES _ArrayAdd ($aArray, FileRead ($i & ".txt"), 0, @CRLF) Next _ArraySort ($aArray) _ArrayDisplay ($aArray) Local $aFinal [ubound($aArray)][2], $sValue, $iFinal = -1 For $i = 0 to UBound($aArray)-1 If $aArray[$i] = "" Then ContinueLoop If $aArray[$i] = $sValue Then $aFinal[$iFinal][1] += 1 Else $iFinal += 1 $sValue = $aArray[$i] $aFinal[$iFinal][0] = $sValue $aFinal[$iFinal][1] = 1 EndIf Next ReDim $aFinal[$iFinal+1][2] _ArrayDisplay ($aFinal)
    1 point
  5. quaizywabbit

    ANYGUI.au3

    For those of you who like to manipulate other program windows: 05 MAR, 2007 ANYGUIv2.8 ANYGUIv2.8.au3 modified _GuiTarget( ) to accept array in ControlId parameter to specify x/y CLIENTcoords of point in control (for those pesky .Net controls where controlid/classnameNN change frequently) for example: Dim $coords[2] $coords[0] = 200 ;point x to check in CLIENT COORDS $coords[1] = 29;point y to check in CLIENT COORDS WinActivate("Edit Database Item") $Ctrltarget = _GuiTarget("Edit Database Item", "", "", $coords)
    1 point
×
×
  • Create New...