Winbatch studio AddExtender 64 bits and cClearTVitem

Started by siocnarf, July 18, 2018, 10:58:16 AM

Previous topic - Next topic

siocnarf

Hi,

Quote;RoboScripter
; Made with
;   RoboScripter ver: 45
;   CtlMgr ver: 44040
AddExtender("wwctl64i.dll")

;Title: Tree1
;ID: 1000
;Class: SysTreeView32
;Level: 2

; Default cWndByWndSpec seems OK here
;window1=cWndByWndSpec("#32770","Setup",13,52,1200,61169528,1000,12,1,9,711,1300,7,50,51,1301)
; window1=cWndByWndSpecName("Pilotes des afficheurs braille Humanware pour JAWS - InstallShield Wizard","Setup",13,52,1200,61169528,1000,12,1,9,711,1300,7,50,51,1301)
window1=DllHwnd('Pilotes des afficheurs braille Humanware pour JAWS - InstallShield Wizard')
;ControlHandle=cWndByID(window1,1000)
;ControlHandle=cWndByName(window1,`Tree1~`)
;ControlHandle=cWndByClass(window1,`SysTreeView32`)
ControlHandle=cWndBySeq(window1,4)
cSetFocus(ControlHandle)
cClearTVItem(ControlHandle,"Tree1")     ; Clear SysTreeView32 item



With RobotScripter, I am trying to uncheck a checkbox on Windows 8.1 X64
I am not succeeding with cClearTVItem and I don't understand

So I Paste the code to Winbatch Studio and replace the extender for the 64bits.
1. From debugging in Winbatch Studio, I get a failure on AddExtender item saying "Extender is invalid".
2. If I am compiling with the 64 bits extender then if is failing on csetfocus
3. If I am compiling fully in 32 bits with the 32 bits extender then cClearTVItem is doing nothing.

I am lost.


td

Lost indeed. 

You are getting the "Extender is invalid' error because you are using the 32-bit debugger instead of the 64-bit debugger.  You can only load a 64-bit extender into a 64-bit process so you have to use the 64-bit debugger when you want to load a 64-bit extender.

It is not clear why you want to use the 64-bit version of the extender in the first place.   The only time you should use it is if the application you are attempting to automate is 64-bit and you are using one of the Control Manager functions that injects itself into the target process.  In your case the only function you are using that meets that criterium is cClearTVItem.  Is your Braille display driver installation program 64-bit?

The cSetFocus function is indifferent to whether or not the target window is a 64-bit or 32-bit window so it is unclear why you are having an issue but it isn't likely the result of the bitness of the extender.

cClearTVItem unselects an item.  If an item is already unselected, it will change nothing.   Also unselecting an item is different than removing the focus from the item so you need to distinguish between those different visual cues.  It may also be the case that the control has a default selected item and does not allow for a state of no selected item.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

siocnarf

Hi,

OK I found the 64 button... I changed my script and facing to another issue. If I run the script from winbatch studio then everything is fine and the script is running properly. Then I am compiling it in 64 bit and the exe is not able to do the csetfocus.

"Will extender error 253: Unable to attach to window on line 33 csetfocus(controlhandle)."

Quote;RoboScripter
; Made with
;   RoboScripter ver: 45
;   CtlMgr ver: 44040
;AddExtender("wwctl44i.dll")
AddExtender("wwctl64i.dll")

;Title: Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard
;ID: 0
;Class: #32770
;Level: 1

; Default cWndByWndSpec seems OK here
;ControlHandle=cWndByWndSpec("#32770","Setup",11,50,202,12,1,9,551,52,1300,1200,62021512,2)
;ControlHandle=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",11,50,202,12,1,9,551,52,1300,1200,62021512,2)
ControlHandle=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
ret=WinWaitExist("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard", 120 )  ;Wait for window to exist ;TODO Check title and timeout value
IF ret == @false Then exit


;Title: &Suivant >
;ID: 1
;Class: Button1
;Level: 2

; Default cWndByWndSpec seems OK here
;window1=cWndByWndSpec("#32770","Setup",11,50,202,12,1,9,551,52,1300,1200,62348208,2)
;window1=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",11,50,202,12,1,9,551,52,1300,1200,62348208,2)
window1=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
;ControlHandle=cWndByID(window1,1)
ControlHandle=cWndByName(window1,`Suivant >~`)
; or ControlHandle=cWndBySeq(window1,4)
cSetFocus(ControlHandle)  ; Activates Window
cPostButton(ControlHandle)      ;Alternate to cClickButton
Timedelay(2)

;Title: Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard
;ID: 0
;Class: #32770
;Level: 1

; Default cWndByWndSpec seems OK here
;ControlHandle=cWndByWndSpec("#32770","Setup",13,1,9,12,52,1200,62021512,711,51,50,1300,7,1301,2)
; ControlHandle=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",13,1,9,12,52,1200,62021512,711,51,50,1300,7,1301,2)
ControlHandle=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
ret=WinWaitExist("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard", 30)  ;Wait for window to exist ;TODO Check title and timeout value
IF ret == @false Then exit

;Title: &Installer
;ID: 1
;Class: Button1
;Level: 2

; Default cWndByWndSpec seems OK here
;window1=cWndByWndSpec("#32770","Setup",13,1,9,12,52,1200,62021512,711,51,50,1300,7,1301,2)
; window1=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",13,1,9,12,52,1200,62021512,711,51,50,1300,7,1301,2)
window1=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
;ControlHandle=cWndByID(window1,1)
;ControlHandle=cWndByName(window1,`Installer~`)
ControlHandle=cWndBySeq(window1,1)
cSetFocus(ControlHandle)  ; Activates Window
cPostButton(ControlHandle)      ;Alternate to cClickButton
Timedelay(2)

;Title: Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard
;ID: 0
;Class: #32770
;Level: 1

; Default cWndByWndSpec seems OK here
;ControlHandle=cWndByWndSpec("#32770","Setup",3,6,7,65535)
; ControlHandle=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",3,6,7,65535)
ControlHandle=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
ret=WinWaitExist("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard", 30 )  ;Wait for window to exist ;TODO Check title and timeout value
IF ret == @false Then exit

;Title: &Oui
;ID: 6
;Class: Button1
;Level: 2

; Default cWndByWndSpec seems OK here
;window1=cWndByWndSpec("#32770","Setup",3,6,7,65535)
; window1=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",3,6,7,65535)
window1=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
ControlHandle=cWndByID(window1,6)
;ControlHandle=cWndByName(window1,`Oui~`)
;ControlHandle=cWndBySeq(window1,1)
cSetFocus(ControlHandle)  ; Activates Window
cPostButton(ControlHandle)      ;Alternate to cClickButton
Timedelay(2)

; Default cWndByWndSpec seems OK here
;ControlHandle=cWndByWndSpec("#32770","Setup",13,52,501,502,712,12,1,9,711,50,1300,551,1200,62021512)
; ControlHandle=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",13,52,501,502,712,12,1,9,711,50,1300,551,1200,62021512)
ControlHandle=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
ret=WinWaitExist("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard", 30 )  ;Wait for window to exist ;TODO Check title and timeout value
IF ret == @false Then exit

;Title: Terminer
;ID: 1
;Class: Button1
;Level: 2

; Default cWndByWndSpec seems OK here
;window1=cWndByWndSpec("#32770","Setup",13,52,501,502,712,12,1,9,711,50,1300,551,1200,62021512)
; window1=cWndByWndSpecName("Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard","Setup",13,52,501,502,712,12,1,9,711,50,1300,551,1200,62021512)
window1=DllHwnd('Pilote Brailliant BI de Humanware pour JAWS - InstallShield Wizard')
;ControlHandle=cWndByID(window1,1)
ControlHandle=cWndByName(window1,`Terminer~`)
;ControlHandle=cWndBySeq(window1,6)
cSetFocus(ControlHandle)  ; Activates Window
cPostButton(ControlHandle)      ;Alternate to cClickButton

td

If it works in WinBatch Studio but not in a compiled script, it is almost certainly a UAC issue.  You need to set your compiled script's UAC settings correctly.  Since you are working with an install program you will likely need to set the executions level to "highestAvailable" or "requireAdministrator".  You may also need to set the uiAccess to "True" but that may depend on how UAC is configured on your system.  Note that if you do set uiAccess to true you may need to run your compiled script from a secure folder but again this will depend on how UAC is configured on your system.

Check out the Compiler Help file for information on configuring UAC settings for compiled scripts.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

siocnarf

Quote from: td on July 18, 2018, 01:08:13 PM
If it works in WinBatch Studio but not in a compiled script, it is almost certainly a UAC issue.  You need to set your compiled script's UAC settings correctly.  Since you are working with an install program you will likely need to set the executions level to "highestAvailable" or "requireAdministrator".  You may also need to set the uiAccess to "True" but that may depend on how UAC is configured on your system.  Note that if you do set uiAccess to true you may need to run your compiled script from a secure folder but again this will depend on your UAC is configured on your system.

Check out the Compiler Help file for information on configuring UAC settings for compiled scripts.


If I run the exe as an administrator, would it be a good test to confirm if its a UAC issue?

td

Why not just make the change to the compiler UAC setting for the script and recompile? 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

To change the settings from the Compiler's dialog  Click on the "Settings" button then select either "highestAvailable" or "requireAdministrator" from the "Requested Execution Level" dropdown box.  If your compiled script does not work with uiAccess Flag set to "false", try setting it to "true".   Note that if you set the flag to "true" and don't sign your script, you may need to run your script from a protected folder like a folder under "Program Files".
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade