Page 1 of 1

Snapshot failure

Posted: Tue Apr 21, 2015 11:05 am
by Helix78
I guess since 6.4 the window snapshot feature or plugin does not work anymore in my Robotask
Before it worked perfectly. The window nade has not changes. I tried to identify the window again. No solution.

>access denied (translated from german)
>WindowSnap failure

Thank you

Re: Snapshot failure

Posted: Tue Apr 21, 2015 1:51 pm
by Oleg
What window do you want to capture? Could you show your task?
You can get such error when you try to capture window of application that require rights elevation. For example REGEDIT.EXE.
This problem can be solved if you run RoboTask "As Administrator" (with rights elevation)

Re: Snapshot failure

Posted: Tue Apr 21, 2015 2:15 pm
by Oleg
You can use Screenshot action.

1. Focus necessary window
2. Take a screenshot

it works, I have tried this.
See my example below:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1166"
Hide=INTEGER|0
ID=INTEGER|19633302
LogOnAsUser=INTEGER|1
Name=STRING|"snapshot of RegEdit window"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER

[Actions\Action1]
ActionID=STRING|"A_WINDOW_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"Focus window ""Registry Editor"""
Params=FOLDER

[Actions\Action1\Params]
action=STRING|"0"
caption=STRING|"1"
child=STRING|"0"
class=STRING|"0"
classexact=STRING|"0"
exact=STRING|"0"
findmode=STRING|"0"
hidden=STRING|"0"
processall=STRING|"0"
wincaption=STRING|"Registry Editor"

[Actions\Action2]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 200 ms"
Params=FOLDER

[Actions\Action2\Params]
delay=STRING|"200"
dimension=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_SCR_SCREEN"
Enabled=INTEGER|-1
Name=STRING|"Screenshot"
Params=FOLDER

[Actions\Action3\Params]
captureregion=STRING|"0"
filename=STRING|"{TempDir}\tmp.jpg"
format=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""tmp.jpg """
Params=FOLDER

[Actions\Action4\Params]
ifnonzero=STRING|"0"
program=STRING|"{TempDir}\tmp.jpg"
runas=STRING|"0"
wait=STRING|"0"

Re: Snapshot failure

Posted: Tue Apr 21, 2015 9:13 pm
by Helix78
Thank you.
I had to start Robotask as Administrator. This seems to be necessary since 6.4
I can do that but when Robotask starts automatically with windows I have to look how to start it as Adminstrator.
fyi: The main user already has the Administrator role on Windows Server 2012

Re: Snapshot failure

Posted: Wed Apr 22, 2015 10:18 am
by Oleg
Starting with Windows Vista the system always reduces the user rights, even the user have administrative rights.
This is new feature of Windows - UAC (User Access Control)
You can turn off it at all (if you need) in control panel. Of course you can start RoboTask "As administrator" mode.

BTW: you can start RoboTask with command line
RoboTask.exe /ADMIN

See mere here about command line options.