Jump to content

Recommended Posts

Posted (edited)

I'm still trying to convert my ahk scripts to au3. :)

I can't find out how to give focus to my Chrome window (or whatever window) if my GUI (created in autoit) is active.

Did I miss something?

This is my code:

WinActivate("[CLASS:Chrome_WidgetWin_1]")
WinWaitActive("[CLASS:Chrome_WidgetWin_1]")

It activates Chrome but does not give it focus when my GUI is still visible or minimized at the taskbar.

I see the Chrome window in front of me but I have to click in it to give it focus, 

(same if I only use the first line (WinActivate without WinWaitActive))

1) How can I give focus to the chrome window in above case?

2) When chrome is minimized on the taskbar above code does not activate chrome.

    Is there a way to activate chrome when it is on the taskbar?

    

    I tried this code but it didn't work: 
WinSetState("[CLASS:Chrome_WidgetWin_1]", "", @SW_SHOW)
Edited by remin
  • Solution
Posted

It activates Chrome but does not give it focus when my GUI is still visible or minimized at the taskbar.

What do you mean?

Does your GUI have the TOPMOST exstyle?

Try this:

#include <Constants.au3>

AutoItSetOption("WinTitleMatchMode", $OPT_MATCHANY) ;2

WinActivate("[TITLE: - Google Chrome;CLASS:Chrome_WidgetWin_1]")
If it does not work try the _WinAPI_SetWindowPos function with the $HWND_TOP/$HWND_TOPMOST parameter.

Br, FireFox.

Posted (edited)

What do you mean?

Does your GUI have the TOPMOST exstyle?

Try this:

#include <Constants.au3>

AutoItSetOption("WinTitleMatchMode", $OPT_MATCHANY) ;2

WinActivate("[TITLE: - Google Chrome;CLASS:Chrome_WidgetWin_1]")
If it does not work try the _WinAPI_SetWindowPos function with the $HWND_TOP/$HWND_TOPMOST parameter.

Br, FireFox.

 

 

It does work (WinActivate("[TITLE: - Google Chrome;CLASS:Chrome_WidgetWin_1]")

Thank you very much.  :thumbsup:

Edited by remin

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
×
×
  • Create New...