Sign in to follow this  
Followers 0
malu05

Winhandle for indentical windows?

6 posts in this topic

Im trying to do a WinFlash on a window.

I got 2 empty notepads open both with the name "Untitled - Notepad"

I use WinList to get a list of active windows and filter our the ones from notepad.exe

i then feed the processID into

Func _WinGetByPID($iPID)
    Local $aWList = WinList()
    For $iCC = 1 To $aWList[0][0]
        If WinGetProcess($aWList[$iCC][1]) = $iPID And _
            BitAND(WinGetState($aWList[$iCC][1]), 2) Then
            Return $aWList[$iCC][0]
        EndIf
    Next
    Return SetError(1, 0, 0)
EndFunc

And try do a WinFlash on both handels.

However only one of them will flash (the one that was last active).

I guess it is a problem with the WinGetByPID function, can someone help me out here?


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites



Think about this:

Return $aWList[$iCC][0]

You return the window TITLE not the handle. Doing WinFlash two times on the same title will obviously flash the same window twice.

Share this post


Link to post
Share on other sites

Think about this:

Return $aWList[$iCC][0]

You return the window TITLE not the handle. Doing WinFlash two times on the same title will obviously flash the same window twice.

Yes i realised but how can you get the Winhandle from the PID then?


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites

The array from WinList has Title in [$n][0] and Handle in [$n][1] :D


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yes i realised but how can you get the Winhandle from the PID then?

You use the handle in WinGetProcess() and WinGetState() and still asks how to get it? You're joking right? :D Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

The array from WinList has Title in [$n][0] and Handle in [$n][1] :D

Ohh lawl... guess it was just a typo then ^^


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

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  
Followers 0