Author Topic: Desktop Application Device Inputs  (Read 1937 times)

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Desktop Application Device Inputs
« on: April 20, 2010, 06:19:13 pm »
Should the .exe be put part of the file path? (see image)

Not sure what I am doing wrong, but sending this script crashes Elve:
MediaCenter.SendKeys(@"{UP}");

hpservertech

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Desktop Application Device Inputs
« Reply #1 on: April 20, 2010, 07:49:18 pm »
I just tried this on mine, didn't have an issue.

Set the device to record diagnostics.  Then from the management studio go to diagnostics, view log.  Keep refreshing till you see an error.  Also on the machine media-pc look at the application & system logs in the windows event viewer.  My guess is that the device service needs to be set to use a log on account for a user local to that machine, or a user with admin rights.  If that's the case I can help you with that.
Current setup: Windows 7 Enterprise x86, x10 cm15a, dedicated master server, dedicated WHS for media

hpservertech

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Desktop Application Device Inputs
« Reply #2 on: April 20, 2010, 07:56:33 pm »
Also, to run the desktop app you will need to run the desktop server on the destination machine as well.

I created the device, then assigned it to a button on a test page in one of my ts pages.  Tested it using a control device, start application and it started up media center just fine.
Current setup: Windows 7 Enterprise x86, x10 cm15a, dedicated master server, dedicated WHS for media

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Desktop Application Device Inputs
« Reply #3 on: April 20, 2010, 08:29:05 pm »
I was able to start and to close windows media center, no problem.  So the basic approach should be correct.

However, if I try to use sendkeys to it, Elve hangs then crashes.  I think it's some kind of issue with the send keys.

I also tried it with notepad.exe and it would start and close, and while I could not get the sendkeys to work properly, it did not hang it either.  Weird.
« Last Edit: April 20, 2010, 08:42:06 pm by Aslamma »

hpservertech

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Desktop Application Device Inputs
« Reply #4 on: April 20, 2010, 08:58:56 pm »
Gotcha, just tried the script.  It didn't crash my entire Elve, but it did lock up the script tester I was using along with the Managment Studio.  Had to do an end task on it and then start it back up again.
Current setup: Windows 7 Enterprise x86, x10 cm15a, dedicated master server, dedicated WHS for media

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Desktop Application Device Inputs
« Reply #5 on: April 20, 2010, 09:03:57 pm »
Thanks for confirming this, sounds like it's a bug perhaps.

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Desktop Application Device Inputs
« Reply #6 on: April 20, 2010, 09:22:10 pm »
I'm looking into this now... my Media Center decided to not work at all for me... even outside of Elve... I'll have to reboot and try again.
« Last Edit: April 21, 2010, 09:53:02 am by John Hughes »
John Hughes
Codecore Technologies

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Desktop Application Device Inputs
« Reply #7 on: April 20, 2010, 09:26:18 pm »
By "crash" do you mean it locks up the script tester? or your get a crash window, etc?

For me it just takes a long time to execute, but I can just ALT-TAB to get control back and wait for the call to timeout.   

I'm still looking into the cause.
John Hughes
Codecore Technologies

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Desktop Application Device Inputs
« Reply #8 on: April 20, 2010, 09:32:23 pm »
Yeah I think it does what you witnessed.  I Am impatient so I may have just killed it and in the process killed Elve.

Can you check to see that the basic commands like up/down work? 

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Desktop Application Device Inputs
« Reply #9 on: April 20, 2010, 09:58:15 pm »
Wow, the Microsoft.NET SendKeys function is flaky!  It doesn't work most of the time.  I'll have to find an alternative.
John Hughes
Codecore Technologies

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Desktop Application Device Inputs
« Reply #10 on: April 21, 2010, 12:30:12 am »
Ok, I think I finally got it. There was a threading issue and it should be much more reliable now.
John Hughes
Codecore Technologies

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Desktop Application Device Inputs
« Reply #11 on: April 21, 2010, 01:10:46 am »
The SendKeys method now sends the keys to the active window and no longer attempts to give the device's specified process focus.
John Hughes
Codecore Technologies

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Desktop Application Device Inputs
« Reply #12 on: April 21, 2010, 06:15:13 am »
Interesting.  So does media center accept the keyboard shortcuts now?  It works 100% of time in eventghost, but doesn't work at all in homeseer. 
« Last Edit: April 21, 2010, 06:22:51 am by Aslamma »

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Desktop Application Device Inputs
« Reply #13 on: April 27, 2010, 07:21:32 am »
We have corrected the media center send keys issue. We created a new Simulated Input driver that simulated keyboard strokes and has been confirmed to work with Windows Media Center.
John Hughes
Codecore Technologies