Jump to content
Sign in to follow this  
efla

How to launch an external program with the remote

Recommended Posts

efla

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

Share this post


Link to post
Moses

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.

Share this post


Link to post
Tjod
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:

Share this post


Link to post
Moses

Ooops... I should never say "there is no way" or similar in conjunction with DVBViewer again :biggrin:

Edited by Moses

Share this post


Link to post
efla

Excellent, thanks for your very fast response !

 

This works great :)

 

BTW, what means the 2 boolean FALSE at the end of the ExecNewProcess command ?

Share this post


Link to post
Tjod
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).

Share this post


Link to post
SimonP

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.)

Share this post


Link to post
SimonP

I followed your instructions but it still doesn't work for me. Is this the correct setting in Options?

post-55522-1220799035_thumb.jpg

Share this post


Link to post
Tjod

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?

Share this post


Link to post
topcaser

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

Share this post


Link to post
webmaher

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 :)

Share this post


Link to post
QBox User

Action 16386 is "Disable AudioVideo".

SendCommand(16836)

in your script should do it.

Share this post


Link to post
webmaher

thanks, @QBox User :)

this works but only when I use remote button directly.

when i want start from OSD Main Menu audio and video still work...

What can I do about that?

Share this post


Link to post
Tjod

You can use the command line parameter -x

...\DVBViewer.exe" –x16836

Share this post


Link to post
webmaher

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 :(

Share this post


Link to post
QBox User

<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>

Share this post


Link to post
webmaher

i try with all possible combination but no success :(

Share this post


Link to post
Tjod

You can't run two programs with one windowdef.xml entry.

You have to run a batch or vb script which than runs the two commands.

Share this post


Link to post
webmaher

i have vb script (Command.vbs)and work only with direct remote button ... how can I do this from OSD Main Menu :(

Share this post


Link to post
Tjod

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

Share this post


Link to post
webmaher

which tag with path to my vbs script must add to windowdef.xml

i try few options with no success :(

Share this post


Link to post
hoodadada

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.

Share this post


Link to post
webmaher

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 :(

Share this post


Link to post
Tjod

<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

Share this post


Link to post
webmaher

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

Share this post


Link to post
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

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

Guest
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.

Sign in to follow this  

×
×
  • Create New...