Jump to content

HOWTO: Use AutoIT3 for DVBViewer control


dbraner

Recommended Posts

Hi,

 

I'm using AutoIT V3 for controlling of my HTPC. With the following code it's easy to send a command to the DVBViewer:

 

$DVBViewer = ObjGet ("", "DVBViewerServer.DVBViewer")

If $DVBViewer = 0 Then

MsgBox (1, "DVBVCommand", "DVBViewer not running")

Else

$DVBViewer.SendCommand ($Code)

EndIf

 

Just substitute $Code with a valid code from actions.ini file.

 

Link to AutoIT: http://www.autoitscript.com/autoit3/

 

Best,

Dirk

Edited by dbraner
Link to comment

very interesting, thx. is it possible to receive com events from DVBViewer with autoit? perhaps you have a script example for this too?

Edited by nuts
Link to comment

It's possible to handle COM events with AutoII. There is a function called ObjEvent. With AutoIT installation comes a help file. See the example code in function reference for ObjEvent.

 

very interesting, thx. is it possible to receive com events from DVBViewer with autoit? perhaps you have a script example for this too?
Link to comment

It doesn't read remote control commands. I'm using it for controlling the launch of some programs when my pc is starting or waking up from standby together with HibernateTrigger. In addition mapping network drives from my NAS and some other functions.

 

With one script i'm starting DVBViewer and wating for windows message WM_QUERYENDSESSION. When message is arriving (if user pressing the power button on my PC) the script is closing DVBViewer and the pc ist going down. Normally DVBViewer is stopping the power down if it's running. Only solution is to start the DVB scheduler.

 

Sample:

 

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

 

Global const $WM_QUERYENDSESSION = 0x0011

 

Func HandleShutdown ($hwndGUI, $MsgId, $WParam, $LParam)

If $MsgId = $WM_QUERYENDSESSION Then

ProcessClose ("DVBViewer.exe")

EndIf

 

Return $GUI_RUNDEFMSG

EndFunc

 

Run ("C:\Programme\DVBViewer\DVBViewer.exe", "C:\Programme\DVBViewer")

 

GUICreate ("DVBLauncher", 200, 200)

GUISetState (@SW_MINIMIZE)

 

GUIRegisterMsg ($WM_QUERYENDSESSION, "HandleShutdown")

 

While 1

$msg = GUIGetMsg ()

 

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Sleep (10)

WEnd

 

GUIDelete ()

 

Sounds interesting. What in particular are you doing with AutoIT? Does it read the remote control commands?

 

klaus.

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