Jump to content

How to launch an external program with the remote


efla

Recommended Posts

Hello,

 

I 'm looking how to launch an external program with the remote control.

 

I'm using the MCE remote control with DVBViewer and I would like to assign a button to launch immediately another program.

 

Is it possible ?

 

Thanks

Link to comment

You can use the osd menue editor to add a menue entry in the DVBViewer osd menue that runs an external application. There is no other way to do it completely in DVBViewer. You could use girder or eventghost to receiver the commands from your remote and then use this application to control DVBViewer and run applications.

Link to comment
Is it possible ?
Yes via Command.vbs.

 

You have to build a Command.vbs in \DVBViewer\Scripts.

 

Command.vbs

sub main(Command)
Select Case Command 
	Case 20480
		OSD.ExecNewProcess "C:\WINDOWS\notepad.exe", "", False, False

	Case 20481
		OSD.ExecNewProcess "C:\Program Files\DVBViewer\TransEdit.exe", "", False, False

	Case Else
		osd.showInfoinTVpic "No action in th Command.vbs for this Action ID.",1000
End Select
end sub

 

And than you have to add a command for Action ID 20480 and bigger.

 

Options > Input > Add Group -> select the new Group >

 

aktionrditor.png

 

And than select a key for the new command.

 

There is no other way to do it completely in DVBViewer.
There is much more possible with the DVBViewer Scripts then most people think (DVBViewer COM Interface). :biggrin:
Link to comment
procedure ExecNewProcess(const ProgramName: WideString; const Params: WideString; Wait: WordBool;LowPriority: WordBool); safecall;

 

Executes a external program.

 

parameters

ProgramName

the complete path and name of the program to execute

Params

the parameters for the program. they have to be enclosed in '"'

Wait

True the DVBViewer waits till the other program has finished False no wait

LowPriority

True the program will be executed with low windows priority False the program will be executed with normal windows priority

The complete description is in the DVBViewer COM Interface.chm (Members Section).

Link to comment

Not knowing what 20480 and 20481 are, should this work with keyboard keys too? I just tried setting it up using F11 and F12 but nothing happens. (I'm on the laptop which has DVBv installed but no remote control hardware.)

Link to comment

Should work, is Options > Scripts the scripting engine enabled?

 

If yes, tray if the Command.vbs is started by pressing the key.

Add

 

osd.showInfoinTVpic "Test",1000

 

at the end of the Command.vbs. Is "Test" displayed by pressing the key?

Link to comment
  • 2 months later...

Works great here. Is it also possible to send a key with SendKey command?

 

I have tried this line:

SendKeys "%(^N)", True

 

to simulate CTRL + ALT + N

 

but alwas get an error message. OSD.SendKeys is not in the API of class OSD. How is it possible to send the keys?

 

Thanks

Link to comment
  • 3 years later...

Hi

 

This is work great, so add external program to oSD menu and remote work OK ... but how I can disable DVBViewer audio/video, when I switch to XBMC...

this is part windowdef.xml:

 

<Window Name="XBMC" Text="XBMC" ID="-4" Parent="0">

<Image>xbmc_bg.png</Image>

<Application>C:\Program Files\XBMC\XBMC.exe</Application>

<Systemwin>0</Systemwin>

</Window>

 

Is possible to add code or arguments or whatever to disable audio/video ...

 

Thanks in advance :)

Link to comment

i try this but no success:

 

<Window Name="XBMC" Text="XBMC" ID="-4" Parent="0">

<Image>xbmc_bg.png</Image>

<Application>C:\Program Files\DVBViewer\DVBViewer.exe" –x16836</Application>

<Application>C:\Program Files\XBMC\XBMC.exe</Application>

<Systemwin>0</Systemwin>

</Window>

 

I have no programming knowledge and do not know exactly what to do :(

Link to comment

<Application>C:\Program Files\DVBViewer\DVBViewer.exe" –x16836</Application>

 

There is only a single quote mark in that line. Don't know if it needs two or none.

Maybe this:

<Application>"C:\Program Files\DVBViewer\DVBViewer.exe" –x16836</Application>

Link to comment

Hello,

What I get that someone wants to lunch another program with the remote control power button.

I have USB IR receiver with my DVB card.

It's power button lunches it's default program.

to change that what I do is:

1- go to desktop where all the shortcuts

2- right click on the default program and select properties.

3- click shortcut tab, and delete the field shortcut key to be (none),then click OK

4- right click on the external program and select properties.

5- click shortcut tab, and activate the field shortcut key and press the power button on the remote control,then click OK

 

I did that after finding that the remote control buttons are mapped to keyboard key/combination of keys.

 

My power button is mapped to ctrl+alt+shift+F6

 

I hope that's useful.

Link to comment

You have to run a batch or vb script via the menu. And run the two programs from this file.

tjod, please help me :(

 

I have Command.vbs script in folder Scripts and when i push button on remote, XBMC start and DVBViewer audio and video stop and thats OK.

But I want also to start XBMC with OSD Main Menu, so If I thinking right I must add a few tags in windowdef.xml file.

I have this now:

 

<Window Name="XBMC" Text="XBMC" ID="-4" Parent="0">

<Image>xbmc_bg.png</Image>

<Application>C:\Program Files\XBMC\XBMC.exe</Application>

<Systemwin>0</Systemwin>

</Window>

 

XBMC start OK, but DVB video and audio still work ...

so probably I must add link to my Command.vbs script without tag <Application> but I dont know how :(

 

Please, help me :(

Link to comment

<Window Name="XBMC" Text="XBMC" ID="-4" Parent="0">
<Image>xbmc_bg.png</Image>
<Application>C:\...  ...\start.bat</Application>
<Systemwin>0</Systemwin>
</Window>

 

start.bat

start "" C:\Programme\DVBViewer\DVBViewer.exe  -c -x16382
start "" C:\Program Files\XBMC\XBMC.exe

Link to comment

thanks very much, Tjod :thumbsup:

 

this is a little modified code and work excellent

 

ECHO OFF
start /d "C:\Program Files\XBMC" XBMC.exe
start /d "C:\Program Files\DVBViewer" DVBViewer.exe  -c -x16836

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...