Jump to content

Search the Community

Showing results for tags 'Winactive'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 4 results

  1. I am capturing data from a web page as soon as it opens. The problem is I am running a dual screen setup and the script don't capture the data when the window is opened up in the non default monitor. On the default monitor it works fine. Func Monitor() Local $hTimer = TimerInit()             Do             $fDiff = TimerDiff($hTimer)         Until WinActive("ActivityDetail - Internet Explorer") Or $fDiff >= 5000     ; Only sees window on default monitor.         If WinActive("ActivityDetail - Internet Explorer") Then                                 ; Only sees window on default monitor.             Local $hWnd = WinGetHandle("ActivityDetail - Internet Explorer", "")             Local $oIE = _IEAttach($hWnd, "hwnd")             If @error Then                 $oIE.Quit()             Else                 Local $oForm = _IEGetObjByName($oIE, "lblHeaderActRefValue")                 Local $Ref = _IEPropertyGet($oForm, "innertext")                 Local $oForm = _IEGetObjByName($oIE, "lblCompileDate")                 Local $Compile = _IEPropertyGet($oForm, "innertext")                 Local $oForm = _IEGetObjByName($oIE, "Table2")                 Local $Description = _IEPropertyGet($oForm, "innertext")                 $Description = StringTrimLeft($Description, 49)                 Local $iLength = StringLen($Description)                 Local $iPosition = StringInStr($Description, "Network Tag")                 Local $sString = StringTrimRight($Description, ($iLength - ($iPosition - 1)))                 Local $sString1 = StringStripWS($sString, $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES)                 Local $sString = $sString1                 Local $oForm = _IEGetObjByName($oIE, "lblDisruption")                 Local $Disruption = _IEPropertyGet($oForm, "innertext")                 If $flag <> $Ref And $Ref <> 0 and $Compile <> 0 Then                     $ICount = _GUICtrlListView_GetItemCount($ListView1)                     _GUICtrlListView_AddItem($ListView1, $Compile, $ICount)                     _GUICtrlListView_AddSubItem($ListView1, $ICount, $Ref, 1)                     _GUICtrlListView_AddSubItem($ListView1, $ICount, $Disruption, 2)                     _GUICtrlListView_AddSubItem($ListView1, $ICount, $sString, 3)                     _FileWriteLog(@ScriptDir & "\" & @YEAR & @MON & ".txt", $Ref & " " & $Disruption & " " & $sString & @CRLF)                     $flag = $Ref                 EndIf             EndIf         EndIf EndFunc   ;==>Monitor
  2. Hello . How to do that $regexp = starts from "abcdef" and after this could be anything in name WinActivate($regexp)
  3. I want to check if the cmd.exe + window of it is running, if it is running I want to put the window to the foreground, but somehow this does not work: Local $sCommandlinePath = "C:\Windows\system32\cmd.exe" RunCm() Func RunCm() If FileExists($sCommandlinePath) Then If ProcessExists("cmd.exe") Then If WinExists("[CLASS:ConsoleWindowClass]") And WinActive("[CLASS:ConsoleWindowClass]") Then Local $hCmdWindow = WinGetHandle("[CLASS:ConsoleWindowClass]") WinSetOnTop($hCmdWindow, "", $WINDOWS_ONTOP) EndIf Else Local $iCmMax = Run($sCommandlinePath, "", @SW_SHOWMAXIMIZED) EndIf EndIf EndFuncI started the command line and put another window above it then I started my script and it did not put the command line window to the foreground.
  4. Hi guys, this is my script: $File1 = @WorkingDir & "\Test1.txt" $File2 = @WorkingDir & "\Test2.txt" $FileNameEstension = StringTrimLeft($File2, StringInStr($File2, "\", 0, -1)) $FileNameOnly = StringTrimRight($FileNameEstension, 4) ClipPut(FileRead($File1)) Start($File2) func Start($File2) If Not FileExists($File2) Then Return 0 Return Run(@ComSpec & " /c " & "start " & FileGetShortName($File2),"",@SW_HIDE) endfunc If WinActive($FileNameOnly & " - Notepad") Then Send("^v") Send("^s") WinClose($FileNameOnly & " - Notepad") First, would know if you can merge this part into a single string: $FileNameEstension = StringTrimLeft($File2, StringInStr($File2, "\", 0, -1)) $FileNameOnly = StringTrimRight($FileNameEstension, 4) The first line give me Test.txt, the second remove the extension. I try to connect with "&" but not work. The script don't work becouse don't recognize the window name: WinActive($FileNameOnly & " - Notepad") I don't know what is the problem. Thanks for support
×
×
  • Create New...