Jump to content
Sign in to follow this  
Akshay07

Put focus on a window without name (and always on the top)

Recommended Posts

Akshay07

Hello,

I am using a program called DUMeter:

http://www.dumeter.com/scrshots.php

Here are some details about this program:

1/ this program does not have a "window title" (see link above)

2/ It is always on the top of all windows

3/ It does not appear in Task Manager-Applications. But it is listed into Task Manager-Processes

I want to put focus on this window and take automatically a screenshot of it, but as it is not listed in the list of active programs, and as it does not have apparently any "window name", I do not know where to start to look for an answer in the help documentation.

Any advice/direction to documentation would be more than welcome!

Share this post


Link to post
Share on other sites
Uriziel01

Hello :)

This function will give you hadles and other info about ALL window's in system (even those not visible) ;)

I hope it was usefull? Cheers.

#include <WinAPI.au3>
Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $aWindows, $i, $text
    $aWindows = _WinAPI_EnumWindows()
    For $i = 1 To UBound($aWindows) - 1
        $text = "Window Handle: " & $aWindows[$i][0] & @LF
        $text &= "Window Class: " & $aWindows[$i][1] & @LF
        $text &= "Window Title: " & WinGetTitle($aWindows[$i][0]) & @LF
        $text &= "Window Text: " & WinGetText($aWindows[$i][0]) & @LF
        $text &= "Window Process: " & WinGetProcess($aWindows[$i][0])
        MsgBox(0, "Item " & $i & " of " & UBound($aWindows) - 1, $text)
    Next
EndFunc   ;==>_Main

EDIT:

Hey! But you could also use a _WinAPI_GetForegroundWindow() function, it is returning a handle to window which is on the top of screen B)

Edited by Uriziel01

Share this post


Link to post
Share on other sites
Akshay07

Thanks a lot! I think I will look into the first solution because it suits better my needs.

Edited by Akshay07

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.