Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/20/2019 in all areas

  1. If you copy and paste your HTML snippet into a unicode text editor, right after the first span tag but before the CRLF, for some odd reason, there is a U+FEFF (Zero Width Non-Breaking Space/BOM). So if your snippet of HTML is accurate, that is why your regular expression probably was not finding any matches. Also, because U+FEFF is a not considered one of the whitespace (\s) regular expression characters, it is why the regular expression supplied by @mikell will not work either. I'm not sure how the BOM got there, whether it is there in error, or whether it truly is a part of your HTML. But if it is truly a part of the HTML body, then you will need to handle it in your regular expression.
    1 point
  2. lolipop, You just need to have both sets of code inside the handler: Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) ; Start by looking for the Date control Switch _WinAPI_LoWord($wParam) ; ControlID of the control Case $cDate1, $cDate2 Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If DllStructGetData($tStruct, "Code") = $DTN_DATETIMECHANGE Then ConsoleWrite("1: " & GUICtrlRead($cDate1) & " - 2: " & GUICtrlRead($cDate2) & @CRLF) EndIf EndSwitch ; And then see if the ListView needs attention Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView ; Local $tBuffer $hWndListView = $Timelog_form_Listview If Not IsHWnd($hWndListView) Then $hWndListView = GUICtrlGetHandle($Timelog_form_Listview) ; etc, etc M23
    1 point
  3. @FireFox I think about this but this is not what he need (I think so) In your example you must change date, but i think, OP want to check date after changing focus Maybe this: #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $date, $msg Local $date, $msg Local $hGui = GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate1 = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20) Local $idDate2 = GUICtrlCreateDate("1953/04/25", 10, 50, 185, 20) Local $button1 = GUICtrlCreateButton("Submit", 10, 100, 50, 50, -1, -1) GUISetState(@SW_SHOW) Local $idLastFocus = 0 ; Local $idNewFocus = 0 ; Loop until the user exits. $idLastFocus = ControlGetFocus($hGui) While 1 ; ConsoleWrite('ControlGetFocus($hGui) = ' & ControlGetFocus($hGui) & @CRLF) If $idLastFocus <> ControlGetFocus($hGui) Then If $idLastFocus = 'SysDateTimePick321' Then ConsoleWrite('Date1 = ' & GUICtrlRead($idDate1) & @CRLF) EndIf If $idLastFocus = 'SysDateTimePick322' Then ConsoleWrite('Date2 = ' & GUICtrlRead($idDate2) & @CRLF) EndIf $idLastFocus = ControlGetFocus($hGui) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idDate1 ConsoleWrite(GUICtrlRead($idDate1) & @CRLF) Case $idDate2 ConsoleWrite(GUICtrlRead($idDate2) & @CRLF) Case $button1 EndSwitch WEnd GUIDelete() EndFunc ;==>Example EDIT: commented Local $idNewFocus = 0 because not needed
    1 point
  4. jdelaney

    IE - Clicking in <SPAN

    Loop through _IETagNameGetCollection $object.className() grabs the class attribute value or .getAttribute to loop by the other attribute or .innertext for the text in the span Then, when found, _ieaction, and exit loop
    1 point
  5. Try this: $oMyError = ObjEvent("AutoIt.Error", "ComErrFunc") ; Prevents COM error crashing script $oAD = ObjCreate("ADSystemInfo") If IsObj($oAD) Then $sComputer = $oAD.ComputerName If @error Then MsgBox(64, "Results", "Not a domain member: " & @ComputerName) Else MsgBox(64, "Results", "Domain member: " & $sComputer) EndIf Else MsgBox(16, "Error", "Failed to create $oAD ADSystemInfo object.") EndIf Func ComErrFunc() $HexNumber = Hex($oMyError.number, 8) Return SetError(1, $HexNumber, 0) EndFunc ;==>ComErrFunc
    1 point
×
×
  • Create New...