Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script works with QM running but not as EXE
#1
I'm using an application named eViacam. It's a headtracker that uses my WebCam to control the mouse. It has a small program window with a WebCam preview (that window doesn't need to be on top for the program to work).

eViacam works fine except it has a tendency to reset my WebCam driver settings on a regular basis. White Balance and Exposure are turned on again causing the frame rate to drop to 15 fps (while it should be 30 fps for smooth Tracking). It could also be that Windows 10 is responsible for this reset. I tried several WebCams the behavior is the same. 

I created the following QM script that unchecks White Balance and Exposure in eViacam settings. It works perfectly from within QM. However, when I create a standalone executable it doesn't work. 

Macro fix WebCam
Code:
Copy      Help
int w=win("Enable Viacam" "wxWindowNR")
Acc a.Find(w "PUSHBUTTON" "Options" "class=ToolbarWindow32[]id=10042" 0x1005)
a.Mouse(1)

key D           ;; Down
1
int w2=win("Configuration" "#32770")
Acc a2.Find(w2 "PUSHBUTTON" "Settings..." "class=Button[]id=10053" 0x1005)
a2.Mouse(1)
1
int w3=win("Properties" "#32770")
Acc a3.Find(w3 "CHECKBUTTON" "" "class=Button[]id=1108" 0x1004)
a3.Mouse(1)
1
int w4=win("Properties" "#32770")
Acc a4.Find(w4 "PAGETAB" "Camera Control" "class=SysTabControl32[]id=12320" 0x1005)
a4.Mouse(1)
1
int w5=win("Properties" "#32770")
Acc a5.Find(w5 "CHECKBUTTON" "" "class=Button[]id=1033" 0x1004)
a5.Mouse(1)
1
int w6=win("Properties" "#32770")
Acc a6.Find(w6 "PUSHBUTTON" "OK" "class=Button[]id=1" 0x1005)
a6.Mouse(1)
1
int w7=win("Configuration" "#32770")
Acc a7.Find(w7 "PUSHBUTTON" "OK" "class=Button[]id=5100" 0x1005)
a7.Mouse(1)

any suggestions would be welcome.
#2
i dont see any obvious problems
i would suggest maybe adding some wait on the acc objects
example

Code:
Copy      Help
int w=wait(3 WV win("This PC" "CabinetWClass"))
Acc a.Find(w "PUSHBUTTON" "Open Settings" "class=NetUIHWND" 0x35 3)
a.DoDefaultAction

try running exe with qm open.Usually will output errors to qm if qm is open.
#3
It says "object not found" when I run the exe. Which is strange because the window handle seems to be correct when I run the script from within QM....
#4
Try adding in wait times like i suggested maybe needs more time  to find the object  also try adjusting  acc settings sometimes  needs less information  sometimes  needs more

also try switching out some of the mouse commands to DoDefaultAction i try and use that command if the object has a default property listed when i click the properties button after i capture the object
#5
Thanks, but still no luck.... 

I inserted the extra wait time, tried adjusting some of the acc settings, but it appears to make no difference. 
a.DoDefaultAction also makes no difference in the executable (although it does improve performance speed in the QM script).

This probably has something to do with the way eViacam is coded. I had trouble activating the window in both AHK and Dragon Scripting as well.
#6
maybe try activating that window also in options put check in
   
and uncheck  error if not found
it may help i dont have the exe so can't help debug much more
#7
I wasn't aware of some of these options. Unchecking the "Error if not found" option does seem to at least activate the eViacam window. However, the other steps still don't work in the executable version.

Thanks for your help so far it's always appreciated.

I think I will just use the QM script for this one, which after all works fine (I will put QM in my startup folder).
#8
Try to run exe as administrator.
#9
Sad 
Thank you Gintaras. This works! I clearly overlooked administrative issues. 

Made a second executable that launches this one as Administrator, so that I can also use it with a keyboard hook.


Forum Jump:


Users browsing this thread: 1 Guest(s)