Jump to content

Recommended Posts

Posted

Hello There.

 

I'm hoping that someone can help me. I'm trying to run a script that will WinActivate a window that does not have a title.
The intention is just to bring the app to the front of all the windows on my desktop.
The class is CLASS:WindowsForms10.Window.8.app.0.11c7a8c

I've tried the following, and it does not work... am I missing something?

WinActivate("[CLASS:WindowsForms10.Window.8.app.0.11c7a8c]","")

Is there any other way to call this application with no title?

Bellinfo.PNG

Posted
28 minutes ago, Nine said:

Have you tried to WinGetHandle (...) first ?  How do you know it is not working ?  What is the error code ?  Try [ACTIVE], see what is going on 

 

So here is my code i'm using for getting the Handle

#include <MsgBoxConstants.au3>
Example()

Func Example()

    Local $hWnd = WinGetHandle("[CLASS:WindowsForms10.Window.8.app.0.11c7a8c]")
    If @error Then
        MsgBox($MB_SYSTEMMODAL, "", "An error occurred when trying to retrieve the window handle of the app")
        Exit
    EndIf


    MsgBox($MB_SYSTEMMODAL, "", $hWnd)



WinActivate($hWnd)


EndFunc   ;==>Example

The handle it returns is "0x00020B12"

as you can see by the image at the start, the handle there shows something different... so it doesn't actually work either... 

Posted
43 minutes ago, IrkenElite86 said:

as you can see by the image at the start, the handle there shows something different... so it doesn't actually work either... 

On the contrary, it means it has worked.  Otherwise the handle would be 0 !

Posted
3 minutes ago, Nine said:

On the contrary, it means it has worked.  Otherwise the handle would be 0 !

Good point...

But it still doesn't bring the window forward, is there another command i can use to do this? Sorry, I'm still fairly new to AutoIt, and I do appreciate your help :D

Posted

use the $hWnd handle on winactivate.  Report the result like $result = WinActivate ($hWnd)

and remember that a window that is "Always On Top" could still cover up a window you Activated.

After a successful activation @extended is set to 1 if the the window was already active, 2 if not.

msgbox both $result and @extended 

Posted
26 minutes ago, Nine said:

use the $hWnd handle on winactivate.  Report the result like $result = WinActivate ($hWnd)

and remember that a window that is "Always On Top" could still cover up a window you Activated.

After a successful activation @extended is set to 1 if the the window was already active, 2 if not.

msgbox both $result and @extended 

Thank you Nine.

I decided to try the script on another application, and everything is working flawlessly. It appears to be just this one application that doesn't want to play nice. I'll have to keep playing around to find a different class value that it will accept and allow itself to be controlled.

Thank you for all your help!

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...