Set Focus on Dialog Box

Discuss RoboTask here
Post Reply
krhoades
Posts: 8
Joined: Wed Oct 24, 2007 7:02 am

Set Focus on Dialog Box

Post by krhoades »

Good Morning!

I have photographs that are downloaded to a folder after the camera is plugged in via the USB port. I have a task that monitors this folder and once it detects the photographs it kicks off a script written in basic that allows you to make choices. It there anyway to set focus to the dialog box that pops up. You just cannot start typing or even hit the tab key. You have to take the mouse and click in the dialog box that pops up. It would be easier to just start typing the order number instead of having to grab the mouse, set focus and then type your order number.

Thanks!
krhoades
Posts: 8
Joined: Wed Oct 24, 2007 7:02 am

Re: Set Focus on Dialog Box

Post by krhoades »

I think I found a work around by adding a window watcher and then using "move to object"
Oleg
Site Admin
Posts: 3049
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Set Focus on Dialog Box

Post by Oleg »

Yes, second task with Window watcher is the best way. I wanted to write about this, but you have found the solution more quickly.

See below the task with Window Watcher. Maybe it will be helpful for somebody else:

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
Events=FOLDER
ExternalName=STRING|"Task839"
Hide=INTEGER|0
ID=INTEGER|1843655335
LogOnAsUser=INTEGER|1
Name=STRING|"Focus window ""Sax ActiveX Scripting""..."
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

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

[Actions\Action1\Params]
action=STRING|"0"
caption=STRING|"0"
child=STRING|"0"
class=STRING|"1"
classexact=STRING|"0"
exact=STRING|"0"
findmode=STRING|"0"
hidden=STRING|"0"
processall=STRING|"0"
wincaption=STRING|"Sax ActiveX Scripting"
winclass=STRING|"WinWrapBasicDynDlgWindow.6"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_WINDOW_WATCHER"
Params=FOLDER
UnigueID=INTEGER|16445953

[Events\Event1\Params]
assignvariable=STRING|"0"
child=STRING|"0"
classexact=STRING|"0"
exact=STRING|"0"
hidden=STRING|"0"
usecaption=STRING|"0"
useclass=STRING|"1"
useparameter=STRING|"0"
watchfor=STRING|"1"
wincaption=STRING|"Sax ActiveX Scripting"
winclass=STRING|"WinWrapBasicDynDlgWindow.6"
This task should catch any BASIC dialog by ClassName.
Oleg Yershov
Post Reply