Try controls with focus.... please help me (1 Viewer)

Brunz

Portal Member
February 26, 2008
7
0
Home Country
Italy Italy
Hello all,

I write a little plugin for Control MP with a Pocketpc, but I have a problems...
As I can get the name of the controls focus?

For example, if I am on home of mediaportal and focus is on My movies, Witch I can get the string (button.text) to send to pda?

Very thanks, and sorry for my bad english
Brunz

Sorry I have wrong section, but I'm new and I don't know as move this...
 

cybrmage

Portal Pro
May 30, 2007
498
86
Home Country
Canada Canada
There are a number of ways you can do this...

You can try something like this:
Code:
GUIWindow cWindow;
int cID;
string ButtonText;

cWindow = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindowEx);
cID = cWindow.GetFocusControlId();
ButtonText = ((GUIButtonControl)cWindow.controlList[cID]).Label;

Keep in mind, however, that each window is composed of a variety of different components, not just button controls. Also, context menus are not of type GUIWindow... so you will need to have some code that will be much more discriminating.

The other way to do it, although it doesn't always give acurate data (it depends on the window that is active setting the property), is something like:

Code:
string ButtonText;
ButtonText = GUIPropertyManager.GetProperty("#highlightedbutton");

Both methods work... the second is easier... but you will need to use a variation of the first method to get the focused button for any dialog box or context menu.

Hope that get you going in the right direction
 

Users who are viewing this thread

Top Bottom