Jump to content

Reading base+address ???


Recommended Posts

Hello 

I need some help reading a memory address from explorer.exe. In VB.NET i wrote a tool that centers the windows 10 taskbar icons automatically. it reads the amount of icons from explorer.exe (base+0x002B8538) then it calculates what the position will be for (MSTaskListWClass). And then it moves (MSTaskListWClass) to the right position using autoitX. (In realtime using a timer). Written for Windows 10 x64

Now i want to script it in Autoit only. But all the solutions about reading memory addresses are very old and do not work for me :(.

I also tried this as an alternative

#Include <GuiToolBar.au3>

$hWnd = ControlGetHandle("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass;INSTANCE:1]")
$iCount = _GUICtrlToolbar_ButtonCount($hWnd)
ConsoleWrite($iCount & @CRLF)

With no success, i tried all controls from _GUICtrl

 

Does anyone have a solution?

 

 

Link to comment
Share on other sites

Hi,

I state that I am not very expert with autoit, but in the last 2 weeks I have learned a few things to have some idea of how you could make the number of icons on the taskbar.  So as you have already said directly read the address apparently does not work, I personally tried and always returns zero. So I propose you this not so complicated solution that with a little patience you can do exactly what you want to do

View the number of open windows( all application in the taskbar) a bit of info you can find in this post ->

Edit: Instead of the cycle for add "_ArrayDisplay($winlist)and include <Array.au3>

Then you have to see the number of apps that are already pinned on the taskbar , you can see the list of links in  

"%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" 

so access the folder and read the elements, from which you can generate an array similar to that of the open windows list 

Finally combining the two arrays you should have the list of apps in the taskbar (and the number of course). "you should" in fact you have to consider some factors like the combined icons, app with multiple instances,background apps etc.

I do not know how much this idea can help you, personally it seems very feasible and I hope you can find a solution

P.S. You did a great job with Falcon10! I love it ^_^

 

Edited by d3ward
Link to comment
Share on other sites

Try this script:

#include <Array.au3>
#include <GuiToolBar.au3>


Get_SysTray_IconText()


Func Get_SysTray_IconText()
    Local $hSysTray_Handle
    For $i = 1 To 99
        ; Find systray handles
        $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:' & $i & ']')
        If @error Then
            ;MsgBox(16, "Error", "System tray not found")
            ExitLoop
        EndIf

        ; Get systray item count
        Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle)
        If $iSysTray_ButCount = 0 Then
            ;MsgBox(16, "Error", "No items found in system tray")
            ContinueLoop
        EndIf

        Local $aSysTray_ButtonText[$iSysTray_ButCount]

        ; Look for tooltips
        For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1
            $aSysTray_ButtonText[$iSysTray_ButtonNumber] = _GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber)
        Next
        _ArrayDisplay($aSysTray_ButtonText, "SysTray Icon Text " & $i, Default, 8)
    Next
EndFunc   ;==>Get_SysTray_IconText

and change to your needs.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...