Jump to content

ControlTreeView With x64 System


Recommended Posts

I'm attempting to control a 32 bit application (Perceptive Content aka ImageNow Client v7.2.3.384) from a Win 10 Enterprise - 64 bit.

 

Everything was going fine until the AntiVirus software updated. Now any 32 application I compile is picked up as a Trojan horse and reported to the IT Security department. So now I have to use `#AutoIt3Wrapper_UseX64=y` to get my code to compile without errors. This makes `ControlTreeView` stop working however. Here's a quick example...

Spoiler

 

; Even when running the script, changing from =n to =y breaks the script
#AutoIt3Wrapper_UseX64=n

Global Const $sImageNowTitle = "Perceptive Content Explorer"
Global Const $sTreeViewTitle = "[ID: 26023; CLASS: SysTreeView32; INSTANCE:1]"

    ; Activate ImageNow
    Local $hWnd = WinActivate($sImageNowTitle)
    
    ; If ImageNow is open
    if $hWnd <> 0 then
        
        WinWaitActive($hWnd)
        
        ; If my search exists in the tree view
        If ControlTreeView($hWnd, "", $sTreeViewTitle, "Exists", "Documents|PS Invoices|My Search") Then
            ; Rest of my code
        Else
            ; Error catching code
        EndIf
        
    EndIf

 

 

TLDR; Is there a way to use the equivalent of a 32-bit ControlTreeView function from a script compiled in 64-bit? Is there another way around this?

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

@Nine I wish it was that easy, but I'm not in IT, I have admin rights, but I can't mess with the AV :( Thank you though!

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

It is not a mess, it is very simple.  I am doing it for lot of my scripts. And it saves my life multiple times.  Even if you find a way around this time, you will be facing the same problem in the future.  So may as well start doing it.

Link to comment
Share on other sites

I think you misunderstood me, when I said "I can't mess with the AV" I meant, I can't change it. IT has the AV software locked, I can only look at values, not change anything about it.

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

That's an interesting problem...maybe something like:

_WinAPI_Wow64EnableWow64FsRedirection

I believe that would force the 32bit windows dlls to be used...with the proper parmater.  Even when compiled 64bit.  Easy to verify in that handles returned will be half the character count.

Can you white list a directory with your AV?

 

Edit, unfortunately, the handle returned is always a 64 bit version, disregard this suggestion)

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

  • 3 weeks later...

Try to use _GUICtrlTreeView_FindItemEx() instead of ControlTreeView(Exists) like this:

; Even when running the script, changing from =n to =y breaks the script
#AutoIt3Wrapper_UseX64=n

#include <GuiTreeView.au3>

Global Const $sImageNowTitle = "Perceptive Content Explorer"
Global Const $sTreeViewTitle = "[ID: 26023; CLASS: SysTreeView32; INSTANCE:1]"

    ; Activate ImageNow
    Local $hWnd = WinActivate($sImageNowTitle)

    ; If ImageNow is open
    if $hWnd <> 0 then

        WinWaitActive($hWnd)
        $hTree = ControlGetHandle($hWnd, "", $sTreeViewTitle)

        ; If my search exists in the tree view
;~         If ControlTreeView($hWnd, "", $sTreeViewTitle, "Exists", "Documents|PS Invoices|My Search") Then
        If _GUICtrlTreeView_FindItemEx($hTree, "Documents|PS Invoices|My Search") Then
            ; Rest of my code
        Else
            ; Error catching code
        EndIf

    EndIf

 

Link to comment
Share on other sites

@Zedna Thank you! I tried it, but it never finds the item under x64. The _GUICtrlTreeView_GetText returns empty text for each item, though I can get each of the list view item handles. I'm trying to check further, but I've hit DLL territory... which I don't understand well.

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

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...