Jump to content

How to get IDM Download Panel HWND?


Go to solution Solved by IgImAx,

Recommended Posts

Hi all

For a long time, I am trying to find a way to get the IDM (Internet Download Manager) toolbar HWND, which it called "IDM Download Panel" but no luck! Also I want to find a way to get the text of Listbox it show so I can select desire item from it. I mean this button with red text "Download this video" on it:
image.thumb.png.417f43d6e853fee4db57f568c49fd5de.png

IDM has an extension for all browsers, this extension will display a toolbar over any embedded media (Audi/video) in browsers. By click on it then it let us to download that media in different qualities.

Problem is, "AutoIt Window Info" cannot detect it. But,  WinSpy tool can detect this toolbar and give me the HWND & Class name & etc. But yet, I could not get its HWND by using those information with any AutoIt functions!! I found this old post handy:

Now, I can use

_Mouse_Control_GetInfo()

function and set IDM toolbar position (X, y) to find its HWND and with the same way I am able to get HWND of Listbox of this button too. But yet! this is not the right way to find an object Handler by its position, also still I cannot get the text of each item in list too.

In my search I found this tool:

https://www.autohotkey.com/boards/viewtopic.php?t=26201

With this app: AccViewer.ahk I can get the text of each list, but I have no idea how to convert and use it in AutoIt. Beside that it is using hover over Object trick! I want to use a function like:

ControlGetHandle($IdmToolbarTitle, "", $IdmToolbarClassNN)

to get its HWND and ... .

 

Source of ACC functions:

https://github.com/Drugoy/Autohotkey-scripts-.ahk/blob/master/Libraries/Acc.ahk

 

Thanks in advance

IgImAx

Edited by IgImAx
Add source code of ACC

Teach Others to learn more yourself

My eBooks and Articles in Persian: IgImAx Home! * and more here

Link to post
Share on other sites

it is worth mentioning that I found a small code at this post too:

https://www.autohotkey.com/board/topic/77303-acc-library-ahk-l-updated-09272012/?p=493839 

it can be helpful in case of detecting text under mouse pointer:

f1:: MsgBox % GetTextUnderMouse()

GetTextUnderMouse() {
    Acc := Acc_ObjectFromPoint(child)
    try value := Acc.accValue(child)
    if Not value
        try value := Acc.accName(child)
    return value
}

after run above code if hover mouse over any element in screen and press F1 it will show the how text under it. I can use that trick to search and select between the IDM toolbar menu items.

 

Do we have something similar over here!?

Teach Others to learn more yourself

My eBooks and Articles in Persian: IgImAx Home! * and more here

Link to post
Share on other sites
  • 3 weeks later...
  • Solution

Hi Everyone

I just found the better answer right now!! I was so wrong since I didn't know below things! I hope these help someone else too:

Detect Hidden Control:

Idm Toolbar handler can easily retrieve via this code: (now its is easy!! after 2 years!!)

AutoItSetOption("WinDetectHiddenText", 1) ;~ 1 = Detect hidden text    
Local $IdmClass = "[CLASS:IDM Download Button class]"
Local $IdmHwnd = ControlGetHandle("", "",  $IdmClass )

The key missing line in my entire years was line one! (set WinDetectHiddenText to 1)

 

Detect Odd Context Menu Items:

All credits goes to "Nine" at here. Here how to get the list of all Idm Toolbar menu:

Local $hMenuWnd = WinGetHandle ("[CLASS:#32768]")
Local $hMenu = _SendMessage($hMenuWnd, $MN_GETHMENU)
If Not _GUICtrlMenu_IsMenu($hMenu) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Unable to retrieve context menu handle")
 
Local $iCount = _GUICtrlMenu_GetItemCount ($hMenu)
For $i = 0 to $iCount-1
  ConsoleWrite (_GUICtrlMenu_GetItemText ($hMenu, $i) & @CRLF)
Next

 

Thanks and Happy Codding

IgImAx

 

 

Teach Others to learn more yourself

My eBooks and Articles in Persian: IgImAx Home! * and more here

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...