DVB Dream

Questions and comments specific to a particular plugin should go here.
townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

DVB Dream

Post by townkat » Sat Nov 24, 2007 1:55 pm

Hi,

I just made a plugin for controling of DVB Dream but i have a little problem with it.

If i close dvbdream and start it imediately there is a delay of about 30 seconds untill it start to receive commands again. Probably FindWindow still sends the messages to the old window, but i don't know how to fix this.

Except that it works perfectly. :D

Thnx.
Attachments
DVBDream.zip
(2.67 KiB) Downloaded 606 times

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: I made a plugin to control DVB Dream :D

Post by Bitmonster » Sun Nov 25, 2007 7:26 am

The problem is, that you only look for the "Tfmain" window class and every Delphi application is using this. So you mainly have two options:

1. Ask the developers of DVB Dream to use a unique window class.
2. Use a more sophisticated FindWindow to get the handle. Pako has used the FindWindow of the Window plugin in his Billy plugin. This allows to limit the search on windows of a specific executable.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: I made a plugin to control DVB Dream :D

Post by townkat » Sun Nov 25, 2007 1:16 pm

Thnx.

I used the method from Mediaportal, the problem dissapear, thnx :D.
I attached the new version of the plugin.
Attachments
DVBDream.zip
(4.87 KiB) Downloaded 563 times

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: I made a plugin to control DVB Dream :D

Post by Bitmonster » Sun Nov 25, 2007 2:21 pm

Thanks for your contribution. The plugin is included in the latest beta. I'm moving this thread to the plugin forum.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: DVB Dream

Post by townkat » Tue Dec 11, 2007 1:48 am

thnx for including me,
I discovered a problem and i also have a posible solution to it,

I noticed that controling dvbdream from eventghost does not work wile dvbdream is in fullscreen mode.

I do testing of send message function with a macro composed of a remote trigger, find window event, and sendmessage event.
When in dvbdream full screen "search invisible items also" must be checked into Find a window plugin, otherwise dvbdream do not receive messages.

My question is, what is the code equivalent for this option?

The function i use to find the window in code is:

WindowMatcher("dvbdream.exe").Enumerate

How to make code find invisible windows too ?

thnx alot

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: DVB Dream

Post by Bitmonster » Tue Dec 11, 2007 8:45 am

WindowMatcher("dvbdream.exe", includeInvisible=True).Enumerate
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: DVB Dream

Post by townkat » Tue Dec 11, 2007 2:55 pm

It does not seem to work,
WindowMatcher("dvbdream.exe", includeInvisible=True).Enumerate
does not seem to work even when not in fullscreen. any ideas ?
thnx

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: DVB Dream

Post by Bitmonster » Tue Dec 11, 2007 3:38 pm

Please copy the FindWindow action you used successful and paste it here.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: DVB Dream

Post by townkat » Tue Dec 11, 2007 4:20 pm

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1181">
<Action>
Window.FindWindow(u'dvbdream.exe', None, None, None, None, None, True, 1.0, 0)
</Action>
</EventGhost>

i didnt know i could copy/paste that, thnx
i also atached a screenshot
Attachments
find a window.JPG

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: DVB Dream

Post by Bitmonster » Tue Dec 11, 2007 4:31 pm

WindowMatcher takes the same parameters as FindWindow. Some parameters are ignored for Enumerate() (like the timeout and stopMacro). So your call should be:
WindowMatcher(u'dvbdream.exe', None, None, None, None, None, True, 1.0, 0).Enumerate

Keep in mind, that FindWindow and WindowMatcher return a list of windows. Possibly you have more than one hit. The SendMessage action will then send to all found windows, while your code will most likely only send to the first.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: DVB Dream

Post by townkat » Tue Dec 11, 2007 4:58 pm

:D
Working now,
everything seems perfect :D.

I atached the latest version.

Thank you so much. :D
Attachments
DVBDream.zip
(4.87 KiB) Downloaded 483 times

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: DVB Dream

Post by Bitmonster » Tue Dec 11, 2007 5:22 pm

There is a small regress compared to the version before. The idea behind WindowMatcher is, that it compiles its parameters to a more computation friendly form. So the call on the Enumerate method of the compiled WindowMatcher is faster than to build and call it everytime. That's why you should create some global WindowMatcher instance and use the object repeatedly.

The other thing is, that calling the instance and calling Enumerate have some small differences. The __call__ method of the object has side effects that are needed for the FindWindow action and should be avoided by other plugins. To make it short. Don't do:
WindowMatcher(u'dvbdream.exe', None, u'Tfmain', None, None, None, True, 1.0, 0)()[0]
but:

Code: Select all

myWindowMatcher = WindowMatcher(u'dvbdream.exe', None, u'Tfmain', None, None, None, True, 1.0, 0)

def foo():
    hwnd = myWindowMatcher.Enumerate()[0]
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: DVB Dream

Post by townkat » Tue Dec 11, 2007 9:49 pm

I fixed that, but now i noticed another strange behaviour,

Imediately after DVBDream starts findwindow action that works is:
(u'dvbdream.exe', None, u'Tfmain', None, None, 1, True, 1.0, 0)
Imediately after dvbdream gets focus (i click in it's window), i must use a diffrent one, and things dont change back anymore, even if it lost the focus:
(u'dvbdream.exe', None, u'Tfmain', None, None, 2, True, 1.0, 0)

This is probably because the window changes its hierarchic position, but i cannot send directly to the window name because it will only work for me, because the window name is:
"DVB Dream v1.4f - BDA Native (DVB-S) - TechnoTrend BDA/DVB-S Tuner"
Bitmonster wrote:The SendMessage action will then send to all found windows, while your code will most likely only send to the first.
how can i send a message to 2 windows at the same time ?

(u'dvbdream.exe', None, u'Tfmain', None, None, 1, True, 1.0, 0)
(u'dvbdream.exe', None, u'Tfmain', None, None, 2, True, 1.0, 0)

, or maybe you have a better solution

thnx alot

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: DVB Dream

Post by Bitmonster » Tue Dec 11, 2007 10:35 pm

How good is the support of the DVBDream developers? Actually the best solution would be, if they would give the needed target a unique and consistent window class name like "DVBDream Main Window" instead of "Tfmain" (shouldn't be a big problem for them). Then it would also be possible to use the more resource-friendly FindWindow of the Windows API.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

townkat
Plugin Developer
Posts: 13
Joined: Tue Nov 20, 2007 9:30 pm

Re: DVB Dream

Post by townkat » Tue Dec 11, 2007 10:45 pm

Is not bad, but not that good :)
I don't think they will change the name of the window, but i will ask this in their forum.

Btw, you probably ment:
"DVB Dream v1.4f - BDA Native (DVB-S) - TechnoTrend BDA/DVB-S Tuner"
changed to
"DVBDream Main Window",
don't you?

Post Reply