Jump to content

Recommended Posts

Posted

quick answer YES

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 10/4/2021 at 1:53 PM, serena_knight said:

does wingethandle and winactivate work with Edge and or Chrome?

Expand  

@mLipok is absolutely right! 

#include <MsgBoxConstants.au3>
Opt("WinTitleMatchMode", 2) ; 2= Match any substring in the title, 3=exact, 4=advanced

Main()

Func Main()

    Local $hWnd_Chrome
    Local $hWnd_Edge

    MsgBox(64 + $MB_TOPMOST, "Open one istance of Chrome and Edge", "Please open one instance of Chrome and Edge")

    MsgBox(64 + $MB_TOPMOST, "Activate Chrome Window", "Please give focus to Chrome Window")
    WinWaitActive("Chrome")
    $hWnd_Chrome = WinGetHandle("[ACTIVE]")
    MsgBox(64 + $MB_TOPMOST, "WinGetHandle is working", 'WinGetHandle returns ' & $hWnd_Chrome & " for Chrome")

    MsgBox(64 + $MB_TOPMOST, "Activate Edge Window", "Please give focus to Edge Window")
    WinWaitActive("Edge")
    $hWnd_Edge = WinGetHandle("[ACTIVE]")
    MsgBox(64 + $MB_TOPMOST, "WinGetHandle is working", 'WinGetHandle returns ' & $hWnd_Edge  & " for Edge")

    For $i = 1 To 4

        ToolTip("WinActivate-ing Chrome", @DesktopWidth / 2, @DesktopHeight / 2)
        WinActivate($hWnd_Chrome)
        Sleep(800)
        ToolTip("WinActivate-ing Edge", @DesktopWidth / 2, @DesktopHeight / 2)
        WinActivate($hWnd_Edge)
        Sleep(800)
    Next

    ToolTip("")

    Return 0

EndFunc

 

Posted

BTW: You get more and faster replies when you give a meaningful title to your threads ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...