It is currently Fri Sep 10, 2010 2:51 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: DVB Dream
PostPosted: Sat Nov 24, 2007 2:55 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
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 153 times
Top
 Profile  
 
 Post subject: Re: I made a plugin to control DVB Dream :D
PostPosted: Sun Nov 25, 2007 8:26 am 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
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!


Top
 Profile  
 
 Post subject: Re: I made a plugin to control DVB Dream :D
PostPosted: Sun Nov 25, 2007 2:16 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
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 120 times
Top
 Profile  
 
 Post subject: Re: I made a plugin to control DVB Dream :D
PostPosted: Sun Nov 25, 2007 3:21 pm 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
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!


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 2:48 am 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
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


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 9:45 am 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
WindowMatcher("dvbdream.exe", includeInvisible=True).Enumerate

_________________
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 3:55 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
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


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 4:38 pm 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
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!


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 5:20 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
<?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
find a window.JPG [ 52.8 KiB | Viewed 724 times ]
Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 5:31 pm 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
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!


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 5:58 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
:D
Working now,
everything seems perfect :D.

I atached the latest version.

Thank you so much. :D


Attachments:
DVBDream.zip [4.87 KiB]
Downloaded 88 times
Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 6:22 pm 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
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:
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!


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 10:49 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
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


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 11:35 pm 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
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!


Top
 Profile  
 
 Post subject: Re: DVB Dream
PostPosted: Tue Dec 11, 2007 11:45 pm 
Plugin Developer

Joined: Tue Nov 20, 2007 10:30 pm
Posts: 13
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group