Sign in to follow this  
Followers 0
raj9039852537

use of classname with winactivate etc how to find one

5 posts in this topic

Want some sendkey with adobe reader and some other programs. Using Winactivate needs class name, tried to use imagename from taskmanager (Acrord32.exe) for adobe reader but not working

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

Can you please at least make a proper english sentence?

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Maybe you can use Opt("WinTitleMatchMode", 2) to match only the "Adobe Reader" string (it is at the end of the Window title).

If the process name is the only information you have, then you can use something like this :

$res = _WinGetFromProcess("notepad.exe")
MsgBox(0, "", "Window title for notepad : " & $res)

$res = _WinGetFromProcess("notepad.exe", 1)
MsgBox(0, "", "Window handle for notepad : " & $res)

; Returns the Windows Title or Handle, from a Process name or PID
; Process : ProcessName or PID
; iFlag : 0 = returns the title
;         1 = returns the handle
Func _WinGetFromProcess($Process, $iFlag = 0)
    Local $aProcessList = ProcessList($Process)
    
    Local $aWinList = WinList()

    For $i = 1 To $aWinList[0][0]
        If $aWinList[$i][0] <> "" And BitAND(WinGetState($aWinList[$i][1]), 2) Then
            $iPid = WinGetProcess($aWinList[$i][1])
            For $j = 1 To $aProcessList[0][0]
                If $aProcessList[$j][0] = $iPid OR $aProcessList[$j][1]= $iPid Then
                    If $iFlag Then
                        Return $aWinList[$i][1]
                    Else
                        Return $aWinList[$i][0]
                    EndIf
                EndIf
            Next
        EndIf
    Next
    
    Return 0
EndFunc

Share this post


Link to post
Share on other sites

Thanks, for suggession specially firefox bro, the point is i am using net on mobile and it is difficult to concentrate on sentences while typing for me.Bytheway thanks all for suggessions.

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